-
Notifications
You must be signed in to change notification settings - Fork 0
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1199,7 +1199,120 @@ 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 = { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is probably a broader question but how is DTR supposed to know where to send this bundle? Will it be a config option or is it supposed to be dynamic and passed in when the app launches? Theoretically this resource or the MessageHeader should have the info on where to send it.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for now hard code it to send to the the PIS system at the following url: |
||
| 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", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MessageHeader is missing required
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. discussed at meeting, will be added in as part of REMS-86 |
||
| 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" | ||
| } | ||
| }, | ||
| source: { | ||
| // TODO: url should be dynamically created | ||
| // also if DTR expects to recieve a response it | ||
| // will need an endpoint to recieve it at | ||
| endpoint: "http://localhost:3005" | ||
| } | ||
|
|
||
| } | ||
|
|
||
| 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.") | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| body { | ||
| margin: 0; | ||
| padding: 0; | ||
| font-family: sans-serif; | ||
|
|
||
| } | ||
| .left-form { | ||
| width: 50%; | ||
| float: left; | ||
| margin-top: 25px; | ||
| margin-left: 25px; | ||
| padding: 5px; | ||
| } | ||
|
|
||
| .resource-entry{ | ||
| border-left: 4px solid #ffcccb; | ||
| padding: 5px; | ||
| margin-left: 10px; | ||
| border-bottom: 1px solid grey; | ||
| background-color: #ededed; | ||
| width: 800px; | ||
| } | ||
|
|
||
| .resource-entry:hover{ | ||
| border-left: 4px solid #ff6663; | ||
| background-color: #fdfdfd; | ||
| } | ||
|
|
||
| .resource-entry.active{ | ||
| border-left: 4px solid #ff6663; | ||
| background-color: #f5f5f5; | ||
| } | ||
|
|
||
| .details{ | ||
| margin-left: 60px; | ||
| background-color: #ededed; | ||
| width: 750px; | ||
| } | ||
|
|
||
|
|
||
| .submit-btn { | ||
| float: right; | ||
| margin-top: 6px; | ||
| } | ||
|
|
||
|
|
||
| .submit-btn:hover{ | ||
| border-width:1px 3px 1px 1px; | ||
| margin-left:2px; | ||
| margin-top:8px; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| import React, { Component } from "react"; | ||
| import ResourceEntry from './ResourceEntry'; | ||
| import "./RemsInterface.css"; | ||
|
|
||
| import axios from "axios"; | ||
| import { SystemUpdateTwoTone } from "@material-ui/icons"; | ||
|
|
||
|
|
||
| export default class RemsInterface extends Component { | ||
| constructor(props) { | ||
| super(props); | ||
| this.state = { | ||
| claimResponseBundle: null, | ||
| }; | ||
|
|
||
| this.getAxiosOptions = this.getAxiosOptions.bind(this); | ||
| this.sendMessage = this.sendMessage.bind(this); | ||
| this.renderBundle= this.renderBundle.bind(this); | ||
| } | ||
| getAxiosOptions() { | ||
| const options = { | ||
| headers: { | ||
| Accept: "application/json", | ||
| "Content-Type": "application/json" | ||
| } | ||
| }; | ||
| return options; | ||
| } | ||
|
|
||
| sendMessage(destination) { | ||
| console.log(this.props.specialtyRxBundle); | ||
| axios.post(destination, this.props.specialtyRxBundle, this.getAxiosOptions()); | ||
| } | ||
|
|
||
| renderBundle() { | ||
| return this.props.specialtyRxBundle.entry.map((entry) => { | ||
| const resource = entry.resource; | ||
| console.log(resource); | ||
| return( | ||
| <div> | ||
| <ResourceEntry resource={resource}></ResourceEntry> | ||
| </div> | ||
| ) | ||
| }) | ||
| } | ||
| render() { | ||
| return ( | ||
| <div> | ||
| <div className="container left-form"> | ||
| {this.renderBundle()} | ||
| <button className="submit-btn" onClick={()=>{this.sendMessage("http://localhost:3010/api/doctorOder/FHIR")}}>Submit</button> | ||
|
|
||
| </div> | ||
| <div className="right-form"> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 ( | ||
| <div> | ||
| <div className={"resource-entry " + [this.state.viewDetails ? "active" : ""]} onClick={this.openDetails}> | ||
| <div>{this.props.resource["resourceType"]}</div> | ||
| </div> | ||
| {this.state.viewDetails ? <div className="details"><pre>{JSON.stringify(this.props.resource,null,'\t')}</pre></div> : null} | ||
| </div> | ||
| ) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to keep the priorAuthBundle around? Can we just remove it and use the specialtyRxBundle exclusively or does REMS have some use for the priorAuthBundle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its nice to show the synergy between the two but its ultimately not a part of this use case