Skip to content
Merged

Dev #162

Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ VITE_HOOK_TO_SEND = patient-view
VITE_URL_FILTER = http://localhost:3000/*
VITE_USE_INTERMEDIARY = false
VITE_INTERMEDIARY = http://localhost:3003
VITE_DISABLE_MEDICATION_STATUS = false
3,983 changes: 1,609 additions & 2,374 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
"@mui/material": "^5.14.10",
"@mui/styles": "^5.14.10",
"@vitejs/plugin-react": "^4.2.1",
"axios": "^0.18.0",
"axios": "^0.30.0",
"base64url": "^3.0.0",
"classnames": "^2.2.6",
"dotenv": "^16.3.1",
"env-var": "^7.3.1",
"fhirclient": "^2.3.1",
"json-server": "^0.16.3",
"jsrsasign": "^10.2.0",
"json-server": "^1.0.0-beta.3",
"jsrsasign": "^11.0.0",
"keypair": "^1.0.1",
"lodash": "^4.17.15",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-markdown": "^8.0.7",
"react-router-dom": "^6.17.0",
"uuid": "^9.0.1",
"vite": "^5.1.6",
"vite": "^5.4.19",
"vite-tsconfig-paths": "^4.3.2"
},
"scripts": {
Expand All @@ -44,7 +44,7 @@
"devDependencies": {
"@babel/eslint-parser": "^7.22.15",
"@babel/preset-react": "^7.22.15",
"concurrently": "^4.1.0",
"concurrently": "^9.1.2",
"eslint": "^7.32.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.29.0",
Expand Down
10 changes: 5 additions & 5 deletions src/components/RequestBox/RequestBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ const RequestBox = props => {
*/
const sendRx = async () => {
console.log('Sending NewRx to: ' + pimsUrl);
console.log('Getting auth number ');
console.log('Getting case number ');
const medication = createMedicationFromMedicationRequest(request);
const body = makeBody(medication);
const standardEtasuUrl = getMedicationSpecificEtasuUrl(
getDrugCodeableConceptFromMedicationRequest(request),
globalState
);
let authNumber = '';
let caseNumber = '';
await axios({
method: 'post',
url: standardEtasuUrl,
Expand All @@ -241,8 +241,8 @@ const RequestBox = props => {
response.data.parameter?.[0].resource.contained
) {
response.data.parameter?.[0].resource?.contained[0]?.parameter.map(metRequirements => {
if (metRequirements.name === 'auth_number') {
authNumber = metRequirements.valueString;
if (metRequirements.name === 'case_number') {
caseNumber = metRequirements.valueString;
}
});
}
Expand All @@ -253,7 +253,7 @@ const RequestBox = props => {
prefetchedResources.patient,
prefetchedResources.practitioner,
request,
authNumber
caseNumber
);

console.log('Prepared NewRx:');
Expand Down
2 changes: 1 addition & 1 deletion src/containers/RequestBuilder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const RequestBuilder = props => {
return Object.keys(state.request).length === 0;
};

const disableGetMedicationStatus = isOrderNotSelected() || state.loading;
const disableGetMedicationStatus = isOrderNotSelected() || state.loading || globalState.disableMedicationStatus;
const disableGetEtasu = isOrderNotSelected() || state.loading;
const getMedicationStatus = () => {
setState(prevState => ({
Expand Down
17 changes: 5 additions & 12 deletions src/util/buildScript.2017071.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,9 @@ function buildNewRxMedication(doc, medicationRequestResource) {
const coding = medicationCodingList[i];
const system = coding.system.toLowerCase();

if (system.endsWith('rxnorm')) {
// Medication Drug Description
xmlAddTextNode(doc, medicationPrescribed, 'DrugDescription', coding.display);
// Medication Drug Code
var drugDbCode = doc.createElement('DrugDBCode');
xmlAddTextNode(doc, drugDbCode, 'Code', coding.code);
xmlAddTextNode(doc, drugDbCode, 'Qualifier', 'BPK'); // Branded Package BPCK (BPK)
drugCoded.appendChild(drugDbCode);
} else if (system.endsWith('ndc')) {
if (system.endsWith('ndc')) {
// Medication Drug Code
xmlAddTextNode(doc, medicationPrescribed, 'DrugDescription', coding.display);
var productCode = doc.createElement('ProductCode');
xmlAddTextNode(doc, productCode, 'Code', coding.code);
xmlAddTextNode(doc, productCode, 'Qualifier', 'ND'); // National Drug Code (NDC)
Expand Down Expand Up @@ -299,7 +292,7 @@ export default function buildNewRxRequest(
patientResource,
practitionerResource,
medicationRequestResource,
authNumber
caseNumber
) {
var doc = document.implementation.createDocument('', '', null);
var message = doc.createElement('Message');
Expand All @@ -319,8 +312,8 @@ export default function buildNewRxRequest(
const d1 = new Date();
const messageIdValue = d1.getTime();
xmlAddTextNode(doc, header, 'MessageID', messageIdValue);
// Add in auth number here
xmlAddTextNode(doc, header, 'AuthorizationNumber', authNumber);
// Add in case number here
xmlAddTextNode(doc, header, 'AuthorizationNumber', caseNumber);

// SentTime
xmlAddTextNode(doc, header, 'SentTime', d1.toISOString());
Expand Down
12 changes: 2 additions & 10 deletions src/util/buildScript.2022071.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,9 @@ function buildNewRxMedication(doc, medicationRequestResource) {
const coding = medicationCodingList[i];
const system = coding.system.toLowerCase();

if (system.endsWith('rxnorm')) {
// Medication Drug Description
xmlAddTextNode(doc, medicationPrescribed, 'DrugDescription', coding.display);

// Medication Drug Code
var productCode = doc.createElement('ProductCode');
xmlAddTextNode(doc, productCode, 'Code', coding.code);
xmlAddTextNode(doc, productCode, 'Qualifier', 'SBD'); // RxNorm Semantic Branded Drug
drugCoded.appendChild(productCode);
} else if (system.endsWith('ndc')) {
if (system.endsWith('ndc')) {
// Medication NDC
xmlAddTextNode(doc, medicationPrescribed, 'DrugDescription', coding.display);
xmlAddTextNode(doc, drugCoded, 'NDC', coding.code); // 10-digit number
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/util/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ const headerDefinitions = {
type: 'input',
default: env.get('VITE_INTERMEDIARY').asString()
},
disableMedicationStatus: {
display: 'Disable Medication Status',
type: 'check',
default: false
},

hookToSend: {
display: 'Send hook on patient select',
Expand Down
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export default defineConfig({
// depending on your application, base can also be "/"
base: '',
plugins: [react(), viteTsconfigPaths(), nodePolyfills()],
preview: {
allowedHosts: ['.mitre.org', '.us-east-1.elb.amazonaws.com'],
},
define: {
'process.env': process.env
},
Expand Down
Loading