diff --git a/src/components/RemsInterface/RemsInterface.jsx b/src/components/RemsInterface/RemsInterface.jsx index 5afe54a1..90c3607a 100644 --- a/src/components/RemsInterface/RemsInterface.jsx +++ b/src/components/RemsInterface/RemsInterface.jsx @@ -105,13 +105,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.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); @@ -173,14 +176,17 @@ 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.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; - axios.get(`http://localhost:5051/doctorOrders/api/getRx/patient/${patientName}/drug/${prescriptionDisplay}`) - .then((response) => { - this.setState({ response: response }); - }) + axios.get(`http://localhost:5051/doctorOrders/api/getRx/${patientFirstName}/${patientLastName}/${patientDOB}?simpleDrugName=${simpleDrugName}&rxDate=${rxDate}`) + .then((response) => { + this.setState({ response: response }); + }) } refreshBundle() {