Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAH-3519 | Refactor. observations of Concept Details class concatenated and displayed in single line #839

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
20 changes: 14 additions & 6 deletions ui/app/common/obs/models/observation.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,20 @@ Bahmni.Common.Obs.Observation = (function () {
return this.complexData.display;
}

if (this.isConceptNameChiefComplaintData()) {
if (this.groupMembers[0].value.name !== this.translate.instant("CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY")) {
return this.translate.instant("CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY", {chiefComplaint: this.groupMembers[0].value.name, duration: this.groupMembers[1].value, unit: this.groupMembers[2].value.name});
} else {
return this.translate.instant("CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY", {chiefComplaint: this.groupMembers[0].value.name, chiefComplaintText: this.groupMembers[1].value, duration: this.groupMembers[2].value, unit: this.groupMembers[3].value.name});
}
if (this.isConceptClassConceptDetails() && this.groupMembers.length > 0) {
var sortedGroupMembers = this.groupMembers.sort(function (a, b) {
return a.conceptSortWeight - b.conceptSortWeight;
});
var obsValueList = [];
sortedGroupMembers.forEach(function (obs) {
if (obs.value && obs.value.name) {
obsValueList.push(obs.value.name);
}
else {
obsValueList.push(obs.value);
}
});
return obsValueList.join(", ");
}

value = this.value;
Expand Down
2 changes: 1 addition & 1 deletion ui/app/common/obs/views/showObservation.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}"/>
<a href="{{'/document_images/' + observation.value}}" download ng-if="observation.isVideoConcept()" class="button btn fr btn-download"><i class="fa fa-download" aria-hidden="true"></i></a>
</span>
<span ng-if="observation.isConceptNameChiefComplaintData() && observation.groupMembers.length > 1 && observation.formNamespace != null && observation.groupMembers[0].concept.conceptClass != 'Image' && observation.groupMembers[0].concept.conceptClass != 'Video'" class="testUnderPanel left">
<span ng-if="observation.isConceptClassConceptDetails() && observation.groupMembers.length > 0 && observation.formNamespace != null && observation.groupMembers[0].concept.conceptClass != 'Image' && observation.groupMembers[0].concept.conceptClass != 'Video'" class="testUnderPanel left">
<label>{{::(observation.getDisplayValue())}}</label>
</span>
<span ng-if="observation.groupMembers.length==0 && !configIsObservationForImages && observation.concept.conceptClass != 'Image'" class="testUnderPanel left">
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_el.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Démarrer la téléconsultation",
"TELECON_ERROR_KEY": "Erreur lors de la récupération du lien de téléconsultation",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Données sur les plainte principales",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Autre générique",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{plainte principale}} ({{Texte de la plainte principale}}) depuis {{duration}} {{unité}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{plainte principale}} depuis {{duration}} {{unité}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Bonjour #nom du destinataire\nMerci d'avoir visité #Nom du lieu le #date de visite. Votre ordonnance est jointe à ce courriel. Nous vous souhaitons un prompt rétablissement.\nMerci.\n#Nom du lieu\n#Adresse du lieu",
"CHIEF_COMPLAINT_CODED_KEY": "Plainte principale codifiée",
"SIGN_SYMPTOM_DURATION_KEY": "Durée des signes/symptômes",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_hr.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_it.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_km.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_lo.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Iniciar Teleconsulta",
"TELECON_ERROR_KEY": "Erro ao ir procurar a ligação de teleconsulta",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsulta",
"TELECON_ERROR_KEY": "Erro ao buscar o link de teleconsulta",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_te.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
3 changes: 0 additions & 3 deletions ui/app/i18n/clinical/locale_zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@
"START_TELECON_KEY": "Start Teleconsultation",
"TELECON_ERROR_KEY": "Error while fetching teleconsultation link",
"CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY": "Chief Complaint Data",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY": "Other generic",
"CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} ({{chiefComplaintText}}) since {{duration}} {{unit}}",
"CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY": "{{chiefComplaint}} since {{duration}} {{unit}}",
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
Expand Down
17 changes: 3 additions & 14 deletions ui/test/unit/common/obs/observation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@ describe("Observation", function () {
var Observation = Bahmni.Common.Obs.Observation;
var mockTranslateService = {instant: function (translateId, translateInterpolateParams = {}) {
var translatedValues = '';
var { chiefComplaint, chiefComplaintText, duration, unit} = translateInterpolateParams;
switch (translateId) {
case "CHIEF_COMPLAINT_DATA_CONCEPT_NAME_KEY":
translatedValues = 'Chief Complaint Data';
break;
case "CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_KEY":
translatedValues = 'Other generic';
break;
case "CHIEF_COMPLAINT_DATA_OTHER_CONCEPT_TEMPLATE_KEY":
translatedValues = `${chiefComplaint} (${chiefComplaintText}) since ${duration} ${unit}`;
break;
case "CHIEF_COMPLAINT_DATA_WITHOUT_OTHER_CONCEPT_TEMPLATE_KEY":
translatedValues = `${chiefComplaint} since ${duration} ${unit}`;
}
return translatedValues;
}}
Expand Down Expand Up @@ -50,11 +41,9 @@ describe("Observation", function () {
expect(observation.getDisplayValue()).toBe("1 since 2 Hours");
});

it("should return duration for an observation having multiple groupMembers and not null formspace", function () {
var observation = new Observation({"type": "Numeric", "formNamespace": "TestNameSpace", "groupMembers": [{"value": {"name": "Test"}}, {"value": "5"}, {"value": {"name": "weeks"}}], concept: {conceptClass: 'Text', name: "Chief Complaint Data"}}, null, mockTranslateService);
var observationWithOtherGeneric = new Observation({"type": "Numeric", "formNamespace": "TestNameSpace", "groupMembers": [{"value": {"name": "Other generic"}}, {"value": "Test"}, {"value": "5"}, {"value": {"name": "weeks"}}], concept: {conceptClass: 'Text', name: "Chief Complaint Data"}}, null, mockTranslateService);
expect(observation.getDisplayValue()).toBe("Test since 5 weeks");
expect(observationWithOtherGeneric.getDisplayValue()).toBe("Other generic (Test) since 5 weeks");
it("should return observation of concept details concept class sorted and concatenated by comma", function () {
var observation = new Observation({"type": "Numeric", "formNamespace": "TestNameSpace", "groupMembers": [{ "conceptSortWeight" : 2, "value": {"name": "Test"}}, {"conceptSortWeight" : 3, "value": "5"}, {"conceptSortWeight" : 4, "value": { "name": "weeks"}}], concept: {conceptClass: "Concept Details", name: "Chief Complaint Data"}}, null, mockTranslateService);
expect(observation.getDisplayValue()).toBe("Test, 5, weeks");
});

it("should return datetime in specific format", function () {
Expand Down
Loading