@openmrs/ngx-formentry 5.0.1-pre.342 → 5.0.1-pre.345
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/form-entry/value-adapters/diagnosis.adapter.mjs +16 -9
- package/fesm2015/openmrs-ngx-formentry.mjs +15 -8
- package/fesm2015/openmrs-ngx-formentry.mjs.map +1 -1
- package/fesm2020/openmrs-ngx-formentry.mjs +15 -8
- package/fesm2020/openmrs-ngx-formentry.mjs.map +1 -1
- package/package.json +9 -7
- package/styles/ngx-formentry.css +0 -1
|
@@ -13752,7 +13752,7 @@ class DiagnosisValueAdapter {
|
|
|
13752
13752
|
// Create Payload
|
|
13753
13753
|
const payloadDiagnosis = this._createPayloadDiagnosis(value[node.question.key], node.question.extras);
|
|
13754
13754
|
const isNewDiagnosis = existingDiagnoses.every((d) => d.diagnosis.coded.uuid !== value[node.question.key] ||
|
|
13755
|
-
d.certainty !==
|
|
13755
|
+
d.certainty !== 'CONFIRMED' ||
|
|
13756
13756
|
d.rank !== node.question.extras.questionOptions.rank);
|
|
13757
13757
|
if (isNewDiagnosis) {
|
|
13758
13758
|
payload.push(payloadDiagnosis);
|
|
@@ -13811,18 +13811,25 @@ class DiagnosisValueAdapter {
|
|
|
13811
13811
|
return diagnosis;
|
|
13812
13812
|
}
|
|
13813
13813
|
_getDeletedDiagnoses(diagnosisNodes, existingDiagnoses) {
|
|
13814
|
-
return existingDiagnoses
|
|
13815
|
-
|
|
13814
|
+
return existingDiagnoses
|
|
13815
|
+
.filter((existingDiagnosis) => {
|
|
13816
|
+
return !diagnosisNodes?.some((node) => {
|
|
13816
13817
|
if (node instanceof ArrayNode) {
|
|
13817
|
-
return node.control.value.some(value => {
|
|
13818
|
-
return value[node.question.key] ===
|
|
13819
|
-
existingDiagnosis.
|
|
13820
|
-
existingDiagnosis.
|
|
13818
|
+
return node.control.value.some((value) => {
|
|
13819
|
+
return (value[node.question.key] ===
|
|
13820
|
+
existingDiagnosis.diagnosis.coded.uuid &&
|
|
13821
|
+
existingDiagnosis.rank ===
|
|
13822
|
+
node.question.extras.questionOptions.rank &&
|
|
13823
|
+
existingDiagnosis.certainty === 'CONFIRMED');
|
|
13821
13824
|
});
|
|
13822
13825
|
}
|
|
13823
13826
|
return false;
|
|
13824
13827
|
});
|
|
13825
|
-
})
|
|
13828
|
+
})
|
|
13829
|
+
.map((existingDiagnosis) => ({
|
|
13830
|
+
uuid: existingDiagnosis.uuid,
|
|
13831
|
+
voided: true
|
|
13832
|
+
}));
|
|
13826
13833
|
}
|
|
13827
13834
|
_updatedOldDiagnoses(payloadDiagnoses, existingDiagnoses) {
|
|
13828
13835
|
payloadDiagnoses.forEach((p) => {
|