From 2fb5497060c9cdcdd95ebf677d69d19181f8877a Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Thu, 3 Mar 2022 09:36:51 -0500 Subject: [PATCH 1/2] pharmacist bundle --- src/App.jsx | 6 + .../QuestionnaireForm/QuestionnaireForm.jsx | 107 ++++++++++++++++++ 2 files changed, 113 insertions(+) diff --git a/src/App.jsx b/src/App.jsx index 190eb598..0c665df6 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -36,6 +36,7 @@ export default class App extends Component { questionnaire: null, response: null, priorAuthClaim: null, + specialtyRxBundle: null, cqlPrepopulationResults: null, deviceRequest: null, bundle: null, @@ -349,6 +350,10 @@ export default class App extends Component { this.setState({ priorAuthClaim: claimBundle }); } + setSpecialtyRxBundle(specialtyRxBundleParam) { + this.setState({ specialtyRxBundle: specialtyRxBundleParam }); + } + getQuestionByName(question) { //question should be the HTML node const temp = question.getElementsByClassName("lf-item-code ng-hide")[0].innerText.trim(); @@ -609,6 +614,7 @@ export default class App extends Component { attested={this.state.attested} priorAuthReq={this.props.priorAuthReq === "true" ? true : false} setPriorAuthClaim={this.setPriorAuthClaim.bind(this)} + setSpecialtyRxBundle={this.setSpecialtyRxBundle.bind(this)} fhirVersion={this.fhirVersion.toUpperCase()} smart={this.smart} FHIR_PREFIX={this.props.FHIR_PREFIX} diff --git a/src/components/QuestionnaireForm/QuestionnaireForm.jsx b/src/components/QuestionnaireForm/QuestionnaireForm.jsx index e59f7405..81b60519 100644 --- a/src/components/QuestionnaireForm/QuestionnaireForm.jsx +++ b/src/components/QuestionnaireForm/QuestionnaireForm.jsx @@ -1199,7 +1199,114 @@ export default class QuestionnaireForm extends Component { priorAuthBundle.signature = signature; priorAuthBundle.entry.unshift({ resource: priorAuthClaim }); + const specialtyRxBundle = JSON.parse(JSON.stringify(priorAuthBundle)); + specialtyRxBundle.type = "message"; + if (this.makeReference(priorAuthBundle, "MedicationRequest")) { + const pharmacy = { + resourceType: "Organization", + id: "pharm0111", + identifier: [ + { + system: "http://hl7.org/fhir/sid/us-npi", + value: "1837247346" + }, + { + system: "http://terminology.hl7.org/CodeSystem/NCPDPProviderIdentificationNumber", + value: "838283882" + } + ], + telecom: [ + { + system : "phone", + value : "919-234-5174", + use : "work", + rank : "1", + } + ], + address: [ + { + use: "work", + state: "IL", + postalCode: "62864", + city: "Mount Vernon", + line: ["1500 Main St"] + } + ] + } + + const specialtyRxSearchResult = { + resourceType: "Bundle", + type: "searchset", + id: "bundle02", + total: 0, + link: [ + { + relation: "self", + url: "", + } + ], + entry: [] + } + + const specialtyRxParameters = { + resourceType: "Parameters", + id: "param0111", + parameter: [ + { + name: "source-patient", + reference: this.makeReference(priorAuthBundle, "Patient") + }, + { + name: "prescription", + reference: this.makeReference(priorAuthBundle, "MedicationRequest") + }, + { + name: "pharmacy", + reference: "Organization/pharm0111" + }, + { + name: "prescriber", + reference: this.makeReference(priorAuthBundle, "Practitioner") + }, + { + name: "search-result", + reference: "Bundle/bundle02" + }, + + ] + } + + const specialtyRxMessageHeader = { + resourceType: "MessageHeader", + id: "msghdr0111", + event: [ + { + eventCoding: { + system: "http://hl7.org/fhir/us/specialty-rx/CodeSystem/specialty-rx-event-type", + code: "query-response-unsolicited", + } + } + ], + focus: { + parameters: { + reference: "Parameters/param0111" + } + } + + } + + specialtyRxBundle.entry.unshift({ resource: specialtyRxSearchResult }); + specialtyRxBundle.entry.unshift({ resource: pharmacy }); + specialtyRxBundle.entry.unshift({ resource: specialtyRxParameters }); + specialtyRxBundle.entry.unshift({ resource: specialtyRxMessageHeader }); + + } + + console.log("specialtyRx", specialtyRxBundle); + + this.props.setPriorAuthClaim(priorAuthBundle); + this.props.setSpecialtyRxBundle(specialtyRxBundle); } else { alert("Prior Auth Bundle is not available or does not contain enough resources for Prior Auth. Can't submit to prior auth.") } From 6c9013be2302f6ced08cbde144a3352d8d39e95c Mon Sep 17 00:00:00 2001 From: kghoreshi Date: Mon, 7 Mar 2022 18:29:18 -0500 Subject: [PATCH 2/2] send message --- src/App.jsx | 5 +- .../QuestionnaireForm/QuestionnaireForm.jsx | 6 ++ .../RemsInterface/RemsInterface.css | 51 ++++++++++++++++ .../RemsInterface/RemsInterface.jsx | 59 +++++++++++++++++++ .../RemsInterface/ResourceEntry.jsx | 33 +++++++++++ 5 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 src/components/RemsInterface/RemsInterface.css create mode 100644 src/components/RemsInterface/RemsInterface.jsx create mode 100644 src/components/RemsInterface/ResourceEntry.jsx diff --git a/src/App.jsx b/src/App.jsx index 0c665df6..c1818ccc 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -12,6 +12,7 @@ import Testing from "./components/ConsoleBox/Testing"; import UserMessage from "./components/UserMessage/UserMessage"; import TaskPopup from "./components/Popup/TaskPopup"; import PatientSelect from "./components/PatientSelect/PatientSelect"; +import RemsInterface from "./components/RemsInterface/RemsInterface"; // uncomment for testing UserMessage // let sampleError = { @@ -600,8 +601,8 @@ export default class App extends Component { > - {this.state.priorAuthClaim ? ( - + {this.state.specialtyRxBundle ? ( + ) : ( { + const resource = entry.resource; + console.log(resource); + return( +
+ +
+ ) + }) + } + render() { + return ( +
+
+ {this.renderBundle()} + + +
+
+
+
+ ) + } +} diff --git a/src/components/RemsInterface/ResourceEntry.jsx b/src/components/RemsInterface/ResourceEntry.jsx new file mode 100644 index 00000000..acea9ce2 --- /dev/null +++ b/src/components/RemsInterface/ResourceEntry.jsx @@ -0,0 +1,33 @@ +import React, {Component} from 'react' +import "./RemsInterface.css"; + +export default class ResourceEntry extends Component { + constructor(props) { + super(props); + this.state = { + viewDetails: null, + }; + this.openDetails = this.openDetails.bind(this); + + } + + + openDetails() { + + this.setState((prevState) => { + return { viewDetails: !prevState.viewDetails }; + }) + + + } + render() { + return ( +
+
+
{this.props.resource["resourceType"]}
+
+ {this.state.viewDetails ?
{JSON.stringify(this.props.resource,null,'\t')}
: null} +
+ ) + } +} \ No newline at end of file