Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions src/components/SMARTBox/PatientBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,37 +210,6 @@ const PatientBox = (props) => {
}
};

const getDeviceRequest = (patientId) => {
client
.request(`DeviceRequest?subject=Patient/${patientId}`, {
resolveReferences: ['subject', 'performer'],
graph: false,
flat: true
})
.then(result => {
setState(prevState => ({...prevState, deviceRequests: result}));
// now take results and make option
result.data.forEach(e => {
makeOption(e, state.options);
});
});
};

const getServiceRequest = (patientId) => {
client
.request(`ServiceRequest?subject=Patient/${patientId}`, {
resolveReferences: ['subject', 'performer'],
graph: false,
flat: true
})
.then(result => {
setState(prevState => ({...prevState, serviceRequests: result}));
result.data.forEach(e => {
makeOption(e, state.options);
});
});
};

const getMedicationRequest = (patientId) => {
client
.request(`MedicationRequest?subject=Patient/${patientId}`, {
Expand Down Expand Up @@ -287,21 +256,6 @@ const PatientBox = (props) => {
});
};

const getMedicationDispense = (patientId) => {
client
.request(`MedicationDispense?subject=Patient/${patientId}`, {
resolveReferences: ['subject', 'performer'],
graph: false,
flat: true
})
.then(result => {
setState(prevState => ({...prevState, medicationDispenses: result}));
result.data.forEach(e => {
makeOption(e, state.options);
});
});
};

const handleRequestChange = (data, patient) => {
if (data) {
let coding = getCoding(JSON.parse(data));
Expand Down Expand Up @@ -355,10 +309,7 @@ const PatientBox = (props) => {

const getRequests = () => {
const patientId = patient.id;
getDeviceRequest(patientId);
getServiceRequest(patientId);
getMedicationRequest(patientId);
getMedicationDispense(patientId);
};

/**
Expand Down