From 3525aa70fc5d8aaba4cbba0b3cacceaefa131fab Mon Sep 17 00:00:00 2001 From: Patrick LaRocque Date: Tue, 14 Mar 2023 15:03:24 -0400 Subject: [PATCH 1/2] Update interface to PIMS for retrieving the doctorOrders. --- .../RemsInterface/RemsInterface.jsx | 46 +++++++++++-------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/src/components/RemsInterface/RemsInterface.jsx b/src/components/RemsInterface/RemsInterface.jsx index 4f2129b0..eb0fa852 100644 --- a/src/components/RemsInterface/RemsInterface.jsx +++ b/src/components/RemsInterface/RemsInterface.jsx @@ -106,13 +106,16 @@ export default class RemsInterface extends Component { // obtain drug information from database let presciption = this.getResource(this.props.specialtyRxBundle, prescriptionReference); - let prescriptionDisplay = presciption.medicationCodeableConcept.coding[0].display.split(" ")[0]; + let simpleDrugName = presciption.medicationCodeableConcept.coding[0].display.split(" ")[0]; + let rxDate = presciption.medicationCodeableConcept.authoredOn; let patient = this.getResource(this.props.specialtyRxBundle, patientReference); - let patientName = patient.name[0].given[0] + ' ' + patient.name[0].family; + let patientFirstName = patient.name[0].given[0]; + let patientLastName = patient.name[0].family; + let patientDOB = patient.birthDate; - // console.log(`http://localhost:5051/api/getRx/paitent/${patientName}/drug/${prescriptionDisplay}`); + // console.log(`http://localhost:5051/doctorOrders/api/getRx/${patientFirstName}/${patientLastName}/${patientDOB}?simpleDrugName=${simpleDrugName}&rxDate=${rxDate}`); - axios.get(`http://localhost:5051/doctorOrders/api/getRx/patient/${patientName}/drug/${prescriptionDisplay}`, remsAdminResponse.data, this.getAxiosOptions()).then((response) => { + axios.get(`http://localhost:5051/doctorOrders/api/getRx/${patientFirstName}/${patientLastName}/${patientDOB}?simpleDrugName=${simpleDrugName}&rxDate=${rxDate}`, remsAdminResponse.data, this.getAxiosOptions()).then((response) => { this.setState({ response }); console.log(response); console.log(response.data); @@ -160,25 +163,28 @@ export default class RemsInterface extends Component { let params = this.getResource(this.props.specialtyRxBundle, this.props.specialtyRxBundle.entry[0].resource.focus.parameters.reference); - // stakeholder and medication references - let prescriptionReference = ""; - let patientReference = ""; - for (let param of params.parameter) { - if (param.name === "prescription") { - prescriptionReference = param.reference; - } - else if (param.name === "source-patient") { - patientReference = param.reference; - } + // stakeholder and medication references + let prescriptionReference = ""; + let patientReference = ""; + for (let param of params.parameter) { + if (param.name === "prescription") { + prescriptionReference = param.reference; } + else if (param.name === "source-patient") { + patientReference = param.reference; + } + } - // obtain drug information from database - let presciption = this.getResource(this.props.specialtyRxBundle, prescriptionReference); - let prescriptionDisplay = presciption.medicationCodeableConcept.coding[0].display.split(" ")[0]; - let patient = this.getResource(this.props.specialtyRxBundle, patientReference); - let patientName = patient.name[0].given[0] + ' ' + patient.name[0].family; + // obtain drug information from database + let presciption = this.getResource(this.props.specialtyRxBundle, prescriptionReference); + let simpleDrugName = presciption.medicationCodeableConcept.coding[0].display.split(" ")[0]; + let rxDate = presciption.medicationCodeableConcept.authoredOn; + let patient = this.getResource(this.props.specialtyRxBundle, patientReference); + let patientFirstName = patient.name[0].given[0]; + let patientLastName = patient.name[0].family; + let patientDOB = patient.birthDate; - axios.get(`http://localhost:5051/doctorOrders/api/getRx/patient/${patientName}/drug/${prescriptionDisplay}`) + axios.get(`http://localhost:5051/doctorOrders/api/getRx/${patientFirstName}/${patientLastName}/${patientDOB}?simpleDrugName=${simpleDrugName}&rxDate=${rxDate}`) .then((response) => { this.setState({ response: response }); }) From 8feb5b1f2aa2258f65c59abcde2497565c75be04 Mon Sep 17 00:00:00 2001 From: Patrick LaRocque Date: Tue, 14 Mar 2023 15:22:31 -0400 Subject: [PATCH 2/2] Fix issue with pulling rxDate from the prescription. --- src/components/RemsInterface/RemsInterface.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/RemsInterface/RemsInterface.jsx b/src/components/RemsInterface/RemsInterface.jsx index eb0fa852..6a4619fe 100644 --- a/src/components/RemsInterface/RemsInterface.jsx +++ b/src/components/RemsInterface/RemsInterface.jsx @@ -107,7 +107,7 @@ export default class RemsInterface extends Component { // obtain drug information from database let presciption = this.getResource(this.props.specialtyRxBundle, prescriptionReference); let simpleDrugName = presciption.medicationCodeableConcept.coding[0].display.split(" ")[0]; - let rxDate = presciption.medicationCodeableConcept.authoredOn; + let rxDate = presciption.authoredOn; let patient = this.getResource(this.props.specialtyRxBundle, patientReference); let patientFirstName = patient.name[0].given[0]; let patientLastName = patient.name[0].family; @@ -178,7 +178,7 @@ export default class RemsInterface extends Component { // obtain drug information from database let presciption = this.getResource(this.props.specialtyRxBundle, prescriptionReference); let simpleDrugName = presciption.medicationCodeableConcept.coding[0].display.split(" ")[0]; - let rxDate = presciption.medicationCodeableConcept.authoredOn; + let rxDate = presciption.authoredOn; let patient = this.getResource(this.props.specialtyRxBundle, patientReference); let patientFirstName = patient.name[0].given[0]; let patientLastName = patient.name[0].family;