NINS_CODE/bahmniapps/clinical/clinical.min.web.0ca87d56.js

2 lines
33 KiB
JavaScript
Raw Normal View History

2024-12-12 22:37:39 +06:00
"use strict";angular.module("bahmni.common.conceptSet").factory("formService",["$http",function($http){var getFormList=function(encounterUuid){return $http.get(Bahmni.Common.Constants.latestPublishedForms,{params:{encounterUuid:encounterUuid}})},getAllForms=function(){return $http.get(Bahmni.Common.Constants.allFormsUrl,{params:{v:"custom:(version,name,uuid)"}})},getFormDetail=function(formUuid,params){return $http.get(Bahmni.Common.Constants.formUrl+"/"+formUuid,{params:params})},getFormTranslations=function(url,form){return url&&url!==Bahmni.Common.Constants.formTranslationsUrl?$http.get(url):$http.get(Bahmni.Common.Constants.formTranslationsUrl,{params:form})};return{getFormList:getFormList,getAllForms:getAllForms,getFormDetail:getFormDetail,getFormTranslations:getFormTranslations}}]),angular.module("bahmni.common.domain").service("visitService",["$http",function($http){this.getVisit=function(uuid,params){var parameters=params?params:"custom:(uuid,visitId,visitType,patient,encounters:(uuid,encounterType,voided,orders:(uuid,orderType,voided,concept:(uuid,set,name),),obs:(uuid,value,concept,obsDatetime,groupMembers:(uuid,concept:(uuid,name),obsDatetime,value:(uuid,name),groupMembers:(uuid,concept:(uuid,name),value:(uuid,name),groupMembers:(uuid,concept:(uuid,name),value:(uuid,name)))))))";return $http.get(Bahmni.Common.Constants.visitUrl+"/"+uuid,{params:{v:parameters}})},this.endVisit=function(visitUuid){return $http.post(Bahmni.Common.Constants.endVisitUrl+"?visitUuid="+visitUuid,{withCredentials:!0})},this.endVisitAndCreateEncounter=function(visitUuid,bahmniEncounterTransaction){return $http.post(Bahmni.Common.Constants.endVisitAndCreateEncounterUrl+"?visitUuid="+visitUuid,bahmniEncounterTransaction,{withCredentials:!0})},this.updateVisit=function(visitUuid,attributes){return $http.post(Bahmni.Common.Constants.visitUrl+"/"+visitUuid,attributes,{withCredentials:!0})},this.createVisit=function(visitDetails){return $http.post(Bahmni.Common.Constants.visitUrl,visitDetails,{withCredentials:!0})},this.getVisitSummary=function(visitUuid){return $http.get(Bahmni.Common.Constants.visitSummaryUrl,{params:{visitUuid:visitUuid},withCredentials:!0})},this.search=function(parameters){return $http.get(Bahmni.Common.Constants.visitUrl,{params:parameters,withCredentials:!0})},this.getVisitType=function(){return $http.get(Bahmni.Common.Constants.visitTypeUrl,{withCredentials:!0})}}]),angular.module("bahmni.common.domain").service("diagnosisService",["$http","$rootScope",function($http,$rootScope){var self=this;this.getAllFor=function(searchTerm){var url=Bahmni.Common.Constants.emrapiConceptUrl;return $http.get(url,{params:{term:searchTerm,limit:20}})},this.getDiagnoses=function(patientUuid,visitUuid){var url=Bahmni.Common.Constants.bahmniDiagnosisUrl;return $http.get(url,{params:{patientUuid:patientUuid,visitUuid:visitUuid}})},this.deleteDiagnosis=function(obsUuid){var url=Bahmni.Common.Constants.bahmniDeleteDiagnosisUrl;return $http.get(url,{params:{obsUuid:obsUuid}})},this.getDiagnosisConceptSet=function(){return $http.get(Bahmni.Common.Constants.conceptUrl,{method:"GET",params:{v:"custom:(uuid,name,setMembers)",code:Bahmni.Common.Constants.diagnosisConceptSet,source:Bahmni.Common.Constants.emrapiConceptMappingSource},withCredentials:!0})},this.getPastAndCurrentDiagnoses=function(patientUuid,encounterUuid){return self.getDiagnoses(patientUuid).then(function(response){var diagnosisMapper=new Bahmni.DiagnosisMapper($rootScope.diagnosisStatus),allDiagnoses=diagnosisMapper.mapDiagnoses(response.data),pastDiagnoses=diagnosisMapper.mapPastDiagnosis(allDiagnoses,encounterUuid),savedDiagnosesFromCurrentEncounter=diagnosisMapper.mapSavedDiagnosesFromCurrentEncounter(allDiagnoses,encounterUuid);return{pastDiagnoses:pastDiagnoses,savedDiagnosesFromCurrentEncounter:savedDiagnosesFromCurrentEncounter}})},this.populateDiagnosisInformation=function(patientUuid,consultation){return this.getPastAndCurrentDiagnoses(patientUuid,consultation.encounterUuid).then(function(diagnosis){return consultation.pastDiagnoses=diagnosis.pastDiagnoses,consultation.
patientUuid:patientUuid};return conceptSetToBeIncluded&&(params.includeConceptSet=conceptSetToBeIncluded),conceptSetToBeExcluded&&(params.excludeConceptSet=conceptSetToBeExcluded),void 0!==isActive&&(params.isActive=isActive),patientProgramUuid&&(params.patientProgramUuid=patientProgramUuid),$http.get(Bahmni.Common.Constants.bahmniDrugOrderUrl+"/drugOrderDetails",{params:params,withCredentials:!0}).success(function(response){deferred.resolve(response)}),deferred.promise},voidDrugOrder=function(drugOrder){var deferred=$q.defer();return $http["delete"]([Bahmni.Common.Constants.ordersUrl,"/",drugOrder.uuid].join("")).success(function(response){deferred.resolve(response)}),deferred.promise};return{getActiveDrugOrders:getActiveDrugOrders,getConfig:getConfig,getPrescribedDrugOrders:getPrescribedDrugOrders,getPrescribedAndActiveDrugOrders:getPrescribedAndActiveDrugOrders,getNonCodedDrugConcept:getNonCodedDrugConcept,getAllDrugOrdersFor:getAllDrugOrdersFor,voidDrugOrder:voidDrugOrder}}]),Bahmni.Clinical.StateNameEvenTypeMap={"search.patientsearch":"VIEWED_CLINICAL_PATIENT_SEARCH","patient.dashboard.show":"VIEWED_CLINICAL_DASHBOARD","patient.dashboard.show.observations":"VIEWED_OBSERVATIONS_TAB","patient.dashboard.show.diagnosis":"VIEWED_DIAGNOSIS_TAB","patient.dashboard.show.treatment.page":"VIEWED_TREATMENT_TAB","patient.dashboard.show.disposition":"VIEWED_DISPOSITION_TAB","patient.dashboard.show.summary":"VIEWED_DASHBOARD_SUMMARY","patient.dashboard.show.orders":"VIEWED_ORDERS_TAB","patient.dashboard.show.bacteriology":"VIEWED_BACTERIOLOGY_TAB","patient.dashboard.show.investigation":"VIEWED_INVESTIGATION_TAB","patient.visit.summaryprint":"VIEWED_SUMMARY_PRINT","patient.dashboard.visit":"VIEWED_VISIT_DASHBOARD","patient.dashboard.visitPrint":"VIEWED_VISIT_PRINT","patient.dashboard.observation":"VIEWED_DASHBOARD_OBSERVATION","patient.patientProgram.show":"VIEWED_PATIENTPROGRAM"};