11 lines
323 KiB
JavaScript
11 lines
323 KiB
JavaScript
![]() |
"use strict";angular.module("bahmni.common.routeErrorHandler",["ui.router"]).run(["$rootScope",function($rootScope){$rootScope.$on("$stateChangeError",function(event){event.preventDefault()})}]),angular.module("httpErrorInterceptor",[]).config(["$httpProvider",function($httpProvider){var interceptor=["$rootScope","$q",function($rootScope,$q){function stringAfter(value,searchString){var indexOfFirstColon=value.indexOf(searchString);return value.substr(indexOfFirstColon+1).trim()}function getServerError(message){return stringAfter(message,":")}function success(response){return response}function shouldRedirectToLogin(response){var errorMessage=response.data.error?response.data.error.message:response.data;if(errorMessage.search("HTTP Status 403 - Session timed out")>0)return!0}function error(response){var data=response.data,unexpectedError="There was an unexpected issue on the server. Please try again";if(500===response.status){var errorMessage=data.error&&data.error.message?getServerError(data.error.message):unexpectedError;showError(errorMessage)}else if(409===response.status){var errorMessage=data.error&&data.error.message?getServerError(data.error.message):"Duplicate entry error";showError(errorMessage)}else if(0===response.status)showError("Could not connect to the server. Please check your connection and try again");else if(405===response.status)showError(unexpectedError);else if(400===response.status){var errorMessage=data.error&&data.error.message?data.error.message:data.localizedMessage||"Could not connect to the server. Please check your connection and try again";showError(errorMessage)}else if(403===response.status){var errorMessage=data.error&&data.error.message?data.error.message:unexpectedError;shouldRedirectToLogin(response)?$rootScope.$broadcast("event:auth-loginRequired"):showError(errorMessage)}else 404===response.status&&(_.includes(response.config.url,"implementation_config")||_.includes(response.config.url,"locale_")||_.includes(response.config.url,"offlineMetadata")||showError("The requested information does not exist"));return $q.reject(response)}var serverErrorMessages=Bahmni.Common.Constants.serverErrorMessages,showError=function(errorMessage){var result=_.find(serverErrorMessages,function(listItem){return listItem.serverMessage===errorMessage});_.isEmpty(result)&&$rootScope.$broadcast("event:serverError",errorMessage)};return{response:success,responseError:error}}];$httpProvider.interceptors.push(interceptor)}]);var Bahmni=Bahmni||{};Bahmni.Auth=Bahmni.Auth||{},angular.module("authentication",["ui.router"]),Bahmni.Auth.User=function(user){angular.extend(this,user),this.userProperties=user.userProperties||{},this.favouriteObsTemplates=this.userProperties.favouriteObsTemplates?this.userProperties.favouriteObsTemplates.split("###"):[],this.favouriteWards=this.userProperties.favouriteWards?this.userProperties.favouriteWards.split("###"):[],this.recentlyViewedPatients=this.userProperties.recentlyViewedPatients?JSON.parse(this.userProperties.recentlyViewedPatients):[],this.toContract=function(){var user=angular.copy(this);return user.userProperties.favouriteObsTemplates=this.favouriteObsTemplates.join("###"),user.userProperties.favouriteWards=this.favouriteWards.join("###"),user.userProperties.recentlyViewedPatients=JSON.stringify(this.recentlyViewedPatients),delete user.favouriteObsTemplates,delete user.favouriteWards,delete user.recentlyViewedPatients,user},this.addDefaultLocale=function(locale){this.userProperties.defaultLocale=locale},this.addToRecentlyViewed=function(patient,maxPatients){_.some(this.recentlyViewedPatients,{uuid:patient.uuid})||(this.recentlyViewedPatients.unshift({uuid:patient.uuid,name:patient.name,identifier:patient.identifier}),_.size(this.recentlyViewedPatients)>=maxPatients&&(this.recentlyViewedPatients=_.take(this.recentlyViewedPatients,maxPatients)))},this.isFavouriteObsTemplate=function(conceptName){return _.includes(this.favouriteObsTemplates,conceptName)},this.toggleFavoriteObsTemplate=function(conceptName){this.isFavouriteObsTemplate(conceptName)?this.favouriteObsTemplate
|
||
|
"/openmrs/ws/rest/v1/concept?s=byFullySpecifiedName&name=Dosage+Frequency&v=custom:(uuid,name,answers)":"DosageFrequencyConfig","/openmrs/ws/rest/v1/concept?s=byFullySpecifiedName&name=Dosage+Instructions&v=custom:(uuid,name,answers)":"DosageInstructionConfig","/openmrs/ws/rest/v1/bahmnicore/sql/globalproperty?property=bahmni.encounterType.default":"DefaultEncounterType","/openmrs/ws/rest/v1/concept?s=byFullySpecifiedName&name=Stopped+Order+Reason&v=custom:(uuid,name,answers)":"StoppedOrderReasonConfig","/openmrs/ws/rest/v1/ordertype":"OrderType","/openmrs/ws/rest/v1/bahmnicore/config/drugOrders":"DrugOrderConfig","/openmrs/ws/rest/v1/bahmnicore/sql/globalproperty?property=drugOrder.drugOther":"NonCodedDrugConcept"};authenticatedReferenceDataMap["/openmrs/ws/rest/v1/entitymapping?mappingType=location_encountertype&s=byEntityAndMappingType&entityUuid="+(localStorage.getItem("LoginInformation")?JSON.parse(localStorage.getItem("LoginInformation")).currentLocation.uuid:"")]="LoginLocationToEncounterTypeMapping",Bahmni.Common.Constants={hostURL:hostUrl,dateFormat:"dd/mm/yyyy",dateDisplayFormat:"DD-MMM-YYYY",timeDisplayFormat:"hh:mm",emrapiDiagnosisUrl:EMRAPI+"/diagnosis",bahmniDiagnosisUrl:BAHMNI_CORE+"/diagnosis/search",bahmniDeleteDiagnosisUrl:BAHMNI_CORE+"/diagnosis/delete",diseaseTemplateUrl:BAHMNI_CORE+"/diseaseTemplates",AllDiseaseTemplateUrl:BAHMNI_CORE+"/diseaseTemplate",emrapiConceptUrl:EMRAPI+"/concept",encounterConfigurationUrl:BAHMNI_CORE+"/config/bahmniencounter",patientConfigurationUrl:BAHMNI_CORE+"/config/patient",drugOrderConfigurationUrl:BAHMNI_CORE+"/config/drugOrders",emrEncounterUrl:EMRAPI+"/encounter",encounterUrl:RESTWS_V1+"/encounter",locationUrl:RESTWS_V1+"/location",bahmniVisitLocationUrl:BAHMNI_CORE+"/visitLocation",bahmniOrderUrl:BAHMNI_CORE+"/orders",bahmniDrugOrderUrl:BAHMNI_CORE+"/drugOrders",bahmniDispositionByVisitUrl:BAHMNI_CORE+"/disposition/visitWithLocale",bahmniDispositionByPatientUrl:BAHMNI_CORE+"/disposition/patientWithLocale",bahmniSearchUrl:BAHMNI_CORE+"/search",bahmniLabOrderResultsUrl:BAHMNI_CORE+"/labOrderResults",bahmniEncounterUrl:BAHMNI_CORE+"/bahmniencounter",conceptUrl:RESTWS_V1+"/concept",bahmniConceptAnswerUrl:RESTWS_V1+"/bahmniconceptanswer",conceptSearchByFullNameUrl:RESTWS_V1+"/concept?s=byFullySpecifiedName",visitUrl:RESTWS_V1+"/visit",endVisitUrl:BAHMNI_CORE+"/visit/endVisit",endVisitAndCreateEncounterUrl:BAHMNI_CORE+"/visit/endVisitAndCreateEncounter",visitTypeUrl:RESTWS_V1+"/visittype",patientImageUrlByPatientUuid:RESTWS_V1+"/patientImage?patientUuid=",labResultUploadedFileNameUrl:"/uploaded_results/",visitSummaryUrl:BAHMNI_CORE+"/visit/summary",encounterModifierUrl:BAHMNI_CORE+"/bahmniencountermodifier",openmrsUrl:hostUrl+"/openmrs",loggingUrl:hostUrl+"/log/",idgenConfigurationURL:RESTWS_V1+"/idgen/identifiertype",bahmniRESTBaseURL:BAHMNI_CORE+"",observationsUrl:BAHMNI_CORE+"/observations",obsRelationshipUrl:BAHMNI_CORE+"/obsrelationships",encounterImportUrl:BAHMNI_CORE+"/admin/upload/encounter",programImportUrl:BAHMNI_CORE+"/admin/upload/program",conceptImportUrl:BAHMNI_CORE+"/admin/upload/concept",conceptSetImportUrl:BAHMNI_CORE+"/admin/upload/conceptset",drugImportUrl:BAHMNI_CORE+"/admin/upload/drug",labResultsImportUrl:BAHMNI_CORE+"/admin/upload/labResults",referenceTermsImportUrl:BAHMNI_CORE+"/admin/upload/referenceterms",updateReferenceTermsImportUrl:BAHMNI_CORE+"/admin/upload/referenceterms/new",relationshipImportUrl:BAHMNI_CORE+"/admin/upload/relationship",conceptSetExportUrl:BAHMNI_CORE+"/admin/export/conceptset?conceptName=:conceptName",patientImportUrl:BAHMNI_CORE+"/admin/upload/patient",adminImportStatusUrl:BAHMNI_CORE+"/admin/upload/status",programUrl:RESTWS_V1+"/program",programEnrollPatientUrl:RESTWS_V1+"/bahmniprogramenrollment",programStateDeletionUrl:RESTWS_V1+"/programenrollment",programEnrollmentDefaultInformation:"default",programEnrollmentFullInformation:"full",programAttributeTypes:RESTWS_V1+"/programattributetype",relationshipTypesUrl:RESTWS_V1+"/relationshiptype",personAttributeTypeUrl:RESTWS_V1+"/personattributetype",diseaseSummaryPivotUrl:B
|
||
|
savedDiagnosesFromCurrentEncounter:savedDiagnosesFromCurrentEncounter}})},this.populateDiagnosisInformation=function(patientUuid,consultation){return this.getPastAndCurrentDiagnoses(patientUuid,consultation.encounterUuid).then(function(diagnosis){return consultation.pastDiagnoses=diagnosis.pastDiagnoses,consultation.savedDiagnosesFromCurrentEncounter=diagnosis.savedDiagnosesFromCurrentEncounter,consultation})}}]),angular.module("bahmni.common.domain").service("bedService",["$http","$rootScope",function($http,$rootScope){var mapBedDetails=function(response){var results=response.data.results;if(!_.isEmpty(results)){var bed=_.first(results);return{wardName:bed.physicalLocation.parentLocation.display,wardUuid:bed.physicalLocation.parentLocation.uuid,physicalLocationName:bed.physicalLocation.name,bedNumber:bed.bedNumber,bedId:bed.bedId}}};this.setBedDetailsForPatientOnRootScope=function(uuid){var promise=this.getAssignedBedForPatient(uuid);return promise.then(function(bedDetails){$rootScope.bedDetails=bedDetails}),promise},this.getAssignedBedForPatient=function(patientUuid,visitUuid){var params={patientUuid:patientUuid,v:"full"};return visitUuid&&(params.visitUuid=visitUuid,params.s="bedDetailsFromVisit"),$http.get(Bahmni.Common.Constants.bedFromVisit,{method:"GET",params:params,withCredentials:!0}).then(mapBedDetails)},this.assignBed=function(bedId,patientUuid,encounterUuid){var patientJson={patientUuid:patientUuid,encounterUuid:encounterUuid};return $http.post(Bahmni.Common.Constants.bedFromVisit+"/"+bedId,patientJson,{withCredentials:!0,headers:{Accept:"application/json","Content-Type":"application/json"}})},this.getBedInfo=function(bedId){return $http.get(Bahmni.Common.Constants.bedFromVisit+"/"+bedId+"?v=custom:(bedId,bedNumber,patients:(uuid,person:(age,personName:(givenName,familyName),gender),identifiers:(uuid,identifier),),physicalLocation:(name))",{withCredentials:!0})},this.getCompleteBedDetailsByBedId=function(bedId){return $http.get(Bahmni.Common.Constants.bedFromVisit+"/"+bedId,{withCredentials:!0})}}]),angular.module("bahmni.common.domain").factory("configurationService",["$http","$q",function($http,$q){var configurationFunctions={};configurationFunctions.encounterConfig=function(){return $http.get(Bahmni.Common.Constants.encounterConfigurationUrl,{params:{callerContext:"REGISTRATION_CONCEPTS"},withCredentials:!0})},configurationFunctions.patientConfig=function(){var patientConfig=$http.get(Bahmni.Common.Constants.patientConfigurationUrl,{withCredentials:!0});return patientConfig},configurationFunctions.patientAttributesConfig=function(){return $http.get(Bahmni.Common.Constants.personAttributeTypeUrl,{params:{v:"custom:(uuid,name,sortWeight,description,format,concept)"},withCredentials:!0})},configurationFunctions.dosageFrequencyConfig=function(){var dosageFrequencyConfig=$http.get(Bahmni.Common.Constants.conceptSearchByFullNameUrl,{method:"GET",params:{v:"custom:(uuid,name,answers)",name:Bahmni.Common.Constants.dosageFrequencyConceptName},withCredentials:!0});return dosageFrequencyConfig},configurationFunctions.dosageInstructionConfig=function(){var dosageInstructionConfig=$http.get(Bahmni.Common.Constants.conceptSearchByFullNameUrl,{method:"GET",params:{v:"custom:(uuid,name,answers)",name:Bahmni.Common.Constants.dosageInstructionConceptName},withCredentials:!0});return dosageInstructionConfig},configurationFunctions.stoppedOrderReasonConfig=function(){var stoppedOrderReasonConfig=$http.get(Bahmni.Common.Constants.conceptSearchByFullNameUrl,{method:"GET",params:{v:"custom:(uuid,name,answers)",name:Bahmni.Common.Constants.stoppedOrderReasonConceptName},withCredentials:!0});return stoppedOrderReasonConfig},configurationFunctions.consultationNoteConfig=function(){var consultationNoteConfig=$http.get(Bahmni.Common.Constants.conceptSearchByFullNameUrl,{method:"GET",params:{v:"custom:(uuid,name,answers)",name:Bahmni.Common.Constants.consultationNoteConceptName},withCredentials:!0});return consultationNoteConfig},configurationFunctions.radiologyObservationConfig=function(){var radiologyObservationConfig=$http.get(Ba
|
||
|
});attr=attr?attr:{value:""},attr.attributeType=configAttr,attr.attributeType.display=configAttr.name,attrsToBeDisplayed.push(attr)}),program.attributes=attrsToBeDisplayed}),patientPrograms)},this.groupPrograms=function(patientPrograms){var activePrograms=[],endedPrograms=[],groupedPrograms={};if(patientPrograms){var filteredPrograms=this.filterRetiredPrograms(patientPrograms);_.forEach(filteredPrograms,function(program){mapPrograms(program),program.dateCompleted?endedPrograms.push(program):activePrograms.push(program)}),groupedPrograms.activePrograms=_.sortBy(activePrograms,function(program){return moment(program.dateEnrolled).toDate()}).reverse(),groupedPrograms.endedPrograms=_.sortBy(endedPrograms,function(program){return moment(program.dateCompleted).toDate()}).reverse()}return groupedPrograms}}]),Bahmni.Common.Domain.PatientProgramMapper=function(){this.map=function(patientProgram,programAttributeTypes,dateCompleted){var attributeFormatter=new Bahmni.Common.Domain.AttributeFormatter;return{dateEnrolled:moment(Bahmni.Common.Util.DateUtil.getDateWithoutTime(patientProgram.dateEnrolled)).format(Bahmni.Common.Constants.ServerDateTimeFormat),states:patientProgram.states,uuid:patientProgram.uuid,dateCompleted:dateCompleted?moment(dateCompleted).format(Bahmni.Common.Constants.ServerDateTimeFormat):null,outcome:patientProgram.outcomeData?patientProgram.outcomeData.uuid:null,attributes:attributeFormatter.getMrsAttributesForUpdate(patientProgram.patientProgramAttributes,programAttributeTypes,patientProgram.attributes),voided:!!patientProgram.voided,voidReason:patientProgram.voidReason}}};var Bahmni=Bahmni||{};Bahmni.ConceptSet=Bahmni.ConceptSet||{},Bahmni.ConceptSet.FormConditions=Bahmni.ConceptSet.FormConditions||{},angular.module("bahmni.common.conceptSet",["bahmni.common.uiHelper","ui.select2","pasvaz.bindonce","ngSanitize","ngTagsInput"]),angular.module("bahmni.common.conceptSet").directive("buttonSelect",function(){return{restrict:"E",scope:{observation:"=",abnormalObs:"=?"},link:function(scope,element,attrs){attrs.dirtyCheckFlag&&(scope.hasDirtyFlag=!0)},controller:function($scope){$scope.isSet=function(answer){return $scope.observation.hasValueOf(answer)},$scope.select=function(answer){$scope.observation.toggleSelection(answer),$scope.$parent.observation&&"function"==typeof $scope.$parent.observation.onValueChanged&&$scope.$parent.observation.onValueChanged(),$scope.$parent.handleUpdate()},$scope.getAnswerDisplayName=function(answer){var shortName=answer.names?_.first(answer.names.filter(function(name){return"SHORT"===name.conceptNameType})):null;return shortName?shortName.name:answer.displayString}},templateUrl:"../common/concept-set/views/buttonSelect.html"}}),angular.module("bahmni.common.conceptSet").directive("stepper",function(){return{restrict:"E",require:"ngModel",replace:!0,scope:{ngModel:"=",obs:"=",ngClass:"=",focusMe:"="},template:'<div class="stepper clearfix"><button ng-click="decrement()" class="stepper__btn stepper__minus" ng-disabled="obs.disabled">-</button><input id="{{::obs.uniqueId}}" obs-constraints ng-model="ngModel" obs="::obs" ng-class="ngClass" focus-me="focusMe" type="text" class="stepper__field" ng-disabled="obs.disabled" /><button ng-click="increment()" class="stepper__btn stepper__plus" ng-disabled="obs.disabled">+</button></div> ',link:function(scope,element,attrs,ngModelController){function updateModel(offset){var currValue=0;isNaN(ngModelController.$viewValue)?null!=scope.obs.concept.lowNormal&&(currValue=scope.obs.concept.lowNormal-offset):currValue=parseInt(ngModelController.$viewValue),ngModelController.$setViewValue(currValue+offset)}ngModelController.$render=function(){},ngModelController.$formatters.push(function(value){return parseInt(value,10)}),ngModelController.$parsers.push(function(value){return parseInt(value,10)}),scope.increment=function(){if(null!=scope.obs.concept.hiNormal){var currValue=isNaN(ngModelController.$viewValue)?0:ngModelController.$viewValue;currValue<scope.obs.concept.hiNormal&&updateModel(1)}else updateModel(1)},scope.decrement=function(){if(null!=scope.
|
||
|
};this.getGridObservationDisplayValue=function(observation){var memberValues=_.compact(_.map(observation.groupMembers,function(member){return getObservationDisplayValue(member)}));return memberValues.join(", ")};var getLabel=function(concept){var mappedConcept=conceptMapper.map(concept);return mappedConcept.shortName||mappedConcept.name}},Bahmni.ConceptSet.Observation=function(observation,savedObs,conceptUIConfig){var self=this;angular.extend(this,observation),this.isObservation=!0,this.conceptUIConfig=conceptUIConfig[this.concept.name]||[],this.uniqueId=_.uniqueId("observation_"),this.erroneousValue=null,savedObs?(this.uuid=savedObs.uuid,this.value=savedObs.value,this.observationDateTime=savedObs.observationDateTime,this.provider=savedObs.provider):this.value=this.conceptUIConfig.defaultValue,Object.defineProperty(this,"autocompleteValue",{enumerable:!0,get:function(){return null!=this.value&&"object"==typeof this.value?this.value.name:this.value},set:function(newValue){this.__prevValue=this.value,this.value=newValue}}),Object.defineProperty(this,"value",{enumerable:!0,get:function(){return null!=self._value?self._value:(savedObs&&"object"==typeof savedObs.value&&savedObs.value&&(savedObs.value.displayString=savedObs.value.shortName?savedObs.value.shortName:savedObs.value.name),savedObs?savedObs.value:void 0)},set:function(newValue){self.__prevValue=this.value,self._value=newValue,newValue||(savedObs=null),self.onValueChanged()}});var cloneNonTabularObs=function(oldObs){var newGroupMembers=[];return oldObs.groupMembers.forEach(function(member){if(void 0===member.isTabularObs){var clone=member.cloneNew();clone.hidden=member.hidden,newGroupMembers.push(clone)}}),newGroupMembers},getTabularObs=function(oldObs){var tabularObsList=[];return oldObs.groupMembers.forEach(function(member){void 0!==member.isTabularObs&&tabularObsList.push(member)}),tabularObsList},cloneTabularObs=function(oldObs,tabularObsList){return tabularObsList=_.map(tabularObsList,function(tabularObs){var matchingObsList=_.filter(oldObs.groupMembers,function(member){return member.concept.name==tabularObs.concept.name});return new Bahmni.ConceptSet.TabularObservations(matchingObsList,oldObs,conceptUIConfig)}),tabularObsList.forEach(function(tabularObs){oldObs.groupMembers.push(tabularObs)}),oldObs};this.cloneNew=function(){var oldObs=angular.copy(observation);if(oldObs.groupMembers&&oldObs.groupMembers.length>0){oldObs.groupMembers=_.filter(oldObs.groupMembers,function(member){return!member.isMultiSelect});var newGroupMembers=cloneNonTabularObs(oldObs),tabularObsList=getTabularObs(oldObs);oldObs.groupMembers=newGroupMembers,_.isEmpty(tabularObsList)||(oldObs=cloneTabularObs(oldObs,tabularObsList))}new Bahmni.ConceptSet.MultiSelectObservations(conceptUIConfig).map(oldObs.groupMembers);var clone=new Bahmni.ConceptSet.Observation(oldObs,null,conceptUIConfig);return clone.comment=void 0,clone.disabled=this.disabled,clone}},Bahmni.ConceptSet.Observation.prototype={displayValue:function(){if(!(this.possibleAnswers.length>0))return this.value;for(var i=0;i<this.possibleAnswers.length;i++)if(this.possibleAnswers[i].uuid===this.value)return this.possibleAnswers[i].display},isGroup:function(){return!!this.groupMembers&&this.groupMembers.length>0},isComputed:function(){return"Computed"===this.concept.conceptClass},isComputedAndEditable:function(){return"Computed/Editable"===this.concept.conceptClass},isNumeric:function(){return"Numeric"===this.getDataTypeName()},isValidNumeric:function(){return!(!this.isDecimalAllowed()&&this.value&&this.value.toString().indexOf(".")>=0)},isValidNumericValue:function(){var element=document.getElementById(this.uniqueId);return""!==this.value||!element||element.checkValidity()},isText:function(){return"Text"===this.getDataTypeName()},isCoded:function(){return"Coded"===this.getDataTypeName()},isDatetime:function(){return"Datetime"===this.getDataTypeName()},isImage:function(){return this.concept.conceptClass==Bahmni.Common.Constants.imageClassName},isVideo:function(){return this.concept.conceptClass==Bahmni.Common.Constants.videoClassName
|
||
|
self.searchResults=self.searchParameter?self.activePatients.filter(matchingCriteria):self.activePatients},self.filterPatientsByIdentifier=function(){self.filterPatients(matchesId)},self.isSelectedSearch=function(searchType){return self.searchType&&self.searchType.id==searchType.id},self.isCurrentSearchLookUp=function(){return self.searchType&&self.searchType.handler},self.isTileView=function(){return self.searchType&&self.searchType.view===Bahmni.Common.PatientSearch.Constants.searchExtensionTileViewType},self.isTabularView=function(){return self.searchType&&self.searchType.view===Bahmni.Common.PatientSearch.Constants.searchExtensionTabularViewType},self.showPatientCountOnSearchParameter=function(searchType){return showPatientCount(searchType)&&self.searchParameter};var matchesNameOrId=function(patient){return patient.display.toLowerCase().indexOf(self.searchParameter.toLowerCase())!==-1},matchesId=function(patient){return patient.identifier.toLowerCase().indexOf(self.searchParameter.toLowerCase())!==-1},showPatientCount=function(searchType){return self.isSelectedSearch(searchType)&&self.isCurrentSearchLookUp()}},angular.module("bahmni.common.patientSearch").directive("resize",["$window",function($window){var controller=function($scope){$scope.storeWindowDimensions=function(){var windowWidth=window.innerWidth,windowHeight=window.innerHeight,tileWidth=Bahmni.Common.PatientSearch.Constants.patientTileWidth,tileHeight=Bahmni.Common.PatientSearch.Constants.patientTileHeight;$scope.tilesToFit=Math.ceil(windowWidth*windowHeight/(tileWidth*tileHeight)),$scope.tilesToLoad=Math.ceil($scope.tilesToFit*Bahmni.Common.PatientSearch.Constants.tileLoadRatio)};var updateVisibleResults=function(){$scope.visibleResults=$scope.searchResults.slice(0,$scope.tilesToLoad)};$scope.loadMore=function(){var last=$scope.visibleResults.length,more=$scope.searchResults.length-last,toShow=more>$scope.tilesToLoad?$scope.tilesToLoad:more;if(toShow>0)for(var i=1;i<=toShow;i++)$scope.visibleResults.push($scope.searchResults[last+i-1])},$scope.$watch("searchResults",updateVisibleResults),$scope.$watch("tilesToFit",updateVisibleResults)},link=function($scope){$scope.storeWindowDimensions(),angular.element($window).bind("resize",function(){$scope.$apply(function(){$scope.storeWindowDimensions()})})};return{restrict:"E",link:link,controller:controller,transclude:!0,scope:{searchResults:"=",visibleResults:"="},template:'<div ng-transclude infinite-scroll="loadMore()"></div>'}}]),angular.module("bahmni.common.patientSearch").directive("scheduler",["$interval",function($interval){var link=function($scope){var promise,cancelSchedule=function(){promise&&($interval.cancel(promise),promise=null)},startSchedule=function(){promise||(promise=$interval($scope.triggerFunction,1e3*$scope.refreshTime))};$scope.$watch(function(){return $scope.watchOn},function(value){$scope.refreshTime>0&&(value?cancelSchedule():startSchedule())}),$scope.triggerFunction(),$scope.$on("$destroy",function(){cancelSchedule()})};return{restrict:"A",link:link,scope:{refreshTime:"=",watchOn:"=",triggerFunction:"&"}}}]),angular.module("bahmni.common.patientSearch").controller("PatientsListController",["$scope","$window","patientService","$rootScope","appService","spinner","$stateParams","$bahmniCookieStore","printer","configurationService",function($scope,$window,patientService,$rootScope,appService,spinner,$stateParams,$bahmniCookieStore,printer,configurationService){const DEFAULT_FETCH_DELAY=2e3;var patientListSpinner,patientSearchConfig=appService.getAppDescriptor().getConfigValue("patientSearch"),initialize=function(){var searchTypes=appService.getAppDescriptor().getExtensions("org.bahmni.patient.search","config").map(mapExtensionToSearchType);$scope.search=new Bahmni.Common.PatientSearch.Search(_.without(searchTypes,void 0)),$scope.search.markPatientEntry(),$scope.$watch("search.searchType",function(currentSearchType){_.isEmpty(currentSearchType)||fetchPatients(currentSearchType)}),$scope.$watch("search.activePatients",function(activePatientsList){activePatientsList.length>0&&patientListSpinn
|
||
|
element[0].setCustomValidity(valid?"":validationMessage)};scope.$watch(attrs.validateOn,setValidity,!0)};return{link:link,require:"ngModel"}}),angular.module("bahmni.common.uiHelper").directive("singleSubmit",function(){var ignoreSubmit=!1,link=function(scope,element){var submitHandler=function(){ignoreSubmit||(ignoreSubmit=!0,scope.singleSubmit().finally(function(){ignoreSubmit=!1}))};element.on("submit",submitHandler),scope.$on("$destroy",function(){element.off("submit",submitHandler)})};return{scope:{singleSubmit:"&"},restrict:"A",link:link}});var Bahmni=Bahmni||{};Bahmni.Common=Bahmni.Common||{},Bahmni.Common.Logging=Bahmni.Common.Logging||{},angular.module("bahmni.common.logging",[]),angular.module("bahmni.common.logging").config(["$provide",function($provide){$provide.decorator("$exceptionHandler",function($delegate,$injector,$window,$log){var logError=function(exception,cause){try{var messagingService=$injector.get("messagingService"),loggingService=$injector.get("loggingService"),errorMessage=exception.toString(),stackTrace=printStackTrace({e:exception}),errorDetails={timestamp:new Date,browser:$window.navigator.userAgent,errorUrl:$window.location.href,errorMessage:errorMessage,stackTrace:stackTrace,cause:cause||""};loggingService.log(errorDetails),messagingService.showMessage("error",errorMessage),exposeException(errorDetails)}catch(loggingError){$log.warn("Error logging failed"),$log.log(loggingError)}},exposeException=function(exceptionDetails){window.angular_exception=window.angular_exception||[],window.angular_exception.push(exceptionDetails)};return function(exception,cause){$delegate(exception,cause),logError(exception,cause)}})}]),angular.module("bahmni.common.logging").service("loggingService",function(){var log=function(errorDetails){$.ajax({type:"POST",url:"/log",contentType:"application/json",data:angular.toJson(errorDetails)})};return{log:log}});var Bahmni=Bahmni||{};Bahmni.Common=Bahmni.Common||{},Bahmni.Common.Obs=Bahmni.Common.Obs||{},angular.module("bahmni.common.obs",[]),Bahmni.Common.Obs.Observation=function(){var Observation=function(obs,conceptConfig){angular.extend(this,obs),this.concept=obs.concept,this.conceptConfig=conceptConfig};return Observation.prototype={isFormElement:function(){return this.groupMembers&&this.groupMembers.length<=0},isImageConcept:function(){return"Image"===this.concept.conceptClass},isVideoConcept:function(){return"Video"===this.concept.conceptClass},hasPDFAsValue:function(){return this.value.indexOf(".pdf")>0},isComplexConcept:function(){return"Complex"===this.concept.dataType},getComplexDataType:function(){return this.complexData?this.complexData.dataType:null},isLocationRef:function(){return this.isComplexConcept()&&"Location"===this.getComplexDataType()},isProviderRef:function(){return this.isComplexConcept()&&"Provider"===this.getComplexDataType()},getDisplayValue:function(){var value;if("Boolean"===this.type||this.concept&&"Boolean"===this.concept.dataType)return this.value===!0?"OBS_BOOLEAN_YES_KEY":"OBS_BOOLEAN_NO_KEY";if("Datetime"===this.type||this.concept&&"Datetime"===this.concept.dataType){var date=Bahmni.Common.Util.DateUtil.parseDatetime(this.value);return null!=date?Bahmni.Common.Util.DateUtil.formatDateWithTime(date):""}if(this.conceptConfig&&this.conceptConfig.displayMonthAndYear&&(value=Bahmni.Common.Util.DateUtil.getDateInMonthsAndYears(this.value),null!=value))return value;if("Date"===this.type||this.concept&&"Date"===this.concept.dataType)return this.value?Bahmni.Common.Util.DateUtil.formatDateWithoutTime(this.value):"";if(this.isLocationRef())return this.complexData.display;if(this.isProviderRef())return this.complexData.display;value=this.value;var displayValue=value&&(value.shortName||value.name&&(value.name.name||value.name)||value);return this.duration&&(displayValue=displayValue+" "+this.getDurationDisplayValue()),displayValue},getDurationDisplayValue:function(){var durationForDisplay=Bahmni.Common.Util.DateUtil.convertToUnits(this.duration);return"since "+durationForDisplay.value+" "+durationForDisplay.unitName}},Observation}(),Bahmni.C
|
||
|
tableGroup.groupMembers.length>0&&obsGroup.groupMembers.push(tableGroup)}})},self.getTableColumns=function(record){return _.filter(record.control.columnHeaders,function(child){return"label"===child.type})},self.getRecordObservations=function(obsFormFieldPath,obsList){return _.remove(obsList,function(obs){return obs.formFieldPath&&obs.formFieldPath===obsFormFieldPath})},self.createObsGroup=function(record,translationData){var obsGroup={groupMembers:[],concept:{shortName:"",conceptClass:null}},translationKey=record.control.label.translationKey,defaultShortName=record.control.label.value;return obsGroup.concept.shortName=self.getTranslatedShortName(translationData,translationKey,obsGroup,defaultShortName),obsGroup}}]),angular.module("bahmni.common.displaycontrol.observation").directive("bahmniObservation",["encounterService","observationsService","appService","$q","spinner","$rootScope","formRecordTreeBuildService","$translate",function(encounterService,observationsService,appService,$q,spinner,$rootScope,formRecordTreeBuildService,$translate){var controller=function($scope){$scope.print=$rootScope.isBeingPrinted||!1,$scope.showGroupDateTime=$scope.config.showGroupDateTime!==!1;var mapObservation=function(observations){var conceptsConfig=$scope.config.formType===Bahmni.Common.Constants.forms2Type?{}:appService.getAppDescriptor().getConfigValue("conceptSetUI")||{};observations=(new Bahmni.Common.Obs.ObservationMapper).map(observations,conceptsConfig),$scope.config.conceptNames&&(observations=_.filter(observations,function(observation){return _.some($scope.config.conceptNames,function(conceptName){return _.toLower(conceptName)===_.toLower(_.get(observation,"concept.name"))})})),$scope.config.persistOrderOfConcepts?$scope.bahmniObservations=(new Bahmni.Common.DisplayControl.Observation.GroupingFunctions).persistOrderOfConceptNames(observations):$scope.bahmniObservations=(new Bahmni.Common.DisplayControl.Observation.GroupingFunctions).groupByEncounterDate(observations),_.isEmpty($scope.bahmniObservations)?($scope.noObsMessage=$translate.instant(Bahmni.Common.Constants.messageForNoObservation),$scope.$emit("no-data-present-event")):$scope.showGroupDateTime?$scope.bahmniObservations[0].isOpen=!0:_.forEach($scope.bahmniObservations,function(bahmniObs){bahmniObs.isOpen=!0});var formObservations=_.filter(observations,function(obs){return obs.formFieldPath});formObservations.length>0&&formRecordTreeBuildService.build($scope.bahmniObservations,$scope.hasNoHierarchy)},fetchObservations=function(){if($scope.config.formType===Bahmni.Common.Constants.formBuilderDisplayControlType){var getFormNameAndVersion=Bahmni.Common.Util.FormFieldPathUtil.getFormNameAndVersion;encounterService.findByEncounterUuid($scope.config.encounterUuid,{includeAll:!1}).then(function(reponse){var encounterTransaction=reponse.data,observationsForSelectedForm=_.filter(encounterTransaction.observations,function(obs){if(obs.formFieldPath){var obsFormNameAndVersion=getFormNameAndVersion(obs.formFieldPath);return obsFormNameAndVersion.formName===$scope.config.formName}});mapObservation(observationsForSelectedForm)}),$scope.title=$scope.config.formDisplayName}else if($scope.observations)mapObservation($scope.observations,$scope.config),$scope.isFulfilmentDisplayControl=!0;else if($scope.config.observationUuid)$scope.initialization=observationsService.getByUuid($scope.config.observationUuid).then(function(response){mapObservation([response.data],$scope.config)});else if($scope.config.encounterUuid){var fetchForEncounter=observationsService.fetchForEncounter($scope.config.encounterUuid,$scope.config.conceptNames);$scope.initialization=fetchForEncounter.then(function(response){mapObservation(response.data,$scope.config)})}else $scope.enrollment?$scope.initialization=observationsService.fetchForPatientProgram($scope.enrollment,$scope.config.conceptNames,$scope.config.scope,$scope.config.obsIgnoreList).then(function(response){mapObservation(response.data,$scope.config)}):$scope.initialization=observationsService.fetch($scope.patient.uuid,$scope.config.conceptNames,$scope.con
|
||
|
"state"===type?onClickState(value,params):$window.location.href=value};var onClickState=function(value,params){params||(params={}),params.dashboardCachebuster=Math.random(),$state.go(value,params)}};return{restrict:"E",controller:controller,templateUrl:"views/backLinks.html",scope:{type:"=",name:"=",value:"=",params:"=",icon:"=",accessKey:"="}}}]),angular.module("bahmni.ot").controller("surgicalBlockController",["$scope","$q","$state","$stateParams","spinner","surgicalAppointmentService","locationService","appService","messagingService","surgicalAppointmentHelper","surgicalBlockHelper","ngDialog",function($scope,$q,$state,$stateParams,spinner,surgicalAppointmentService,locationService,appService,messagingService,surgicalAppointmentHelper,surgicalBlockHelper,ngDialog){var init=function(){$scope.surgicalForm={surgicalAppointments:[]},$scope.configuredSurgeryAttributeNames=appService.getAppDescriptor().getConfigValue("surgeryAttributes"),$scope.defaultAttributeTranslations=surgicalAppointmentHelper.getDefaultAttributeTranslations();var providerNamesFromConfig=appService.getAppDescriptor().getConfigValue("primarySurgeonsForOT");return $q.all([surgicalAppointmentService.getSurgeons(),locationService.getAllByTag("Operation Theater"),surgicalAppointmentService.getSurgicalAppointmentAttributeTypes()]).then(function(response){return $scope.surgeons=surgicalAppointmentHelper.filterProvidersByName(providerNamesFromConfig,response[0].data.results),$scope.locations=response[1].data.results,$scope.attributeTypes=response[2].data.results,$stateParams.surgicalBlockUuid?surgicalAppointmentService.getSurgicalBlockFor($stateParams.surgicalBlockUuid).then(function(response){$scope.surgicalForm=(new Bahmni.OT.SurgicalBlockMapper).map(response.data,$scope.attributeTypes,$scope.surgeons),$scope.surgicalForm.surgicalAppointments=surgicalAppointmentHelper.filterSurgicalAppointmentsByStatus($scope.surgicalForm.surgicalAppointments,[Bahmni.OT.Constants.scheduled,Bahmni.OT.Constants.completed]);var selectedSurgicalAppointment=_.find($scope.surgicalForm.surgicalAppointments,function(appointment){return appointment.id===$stateParams.surgicalAppointmentId});return selectedSurgicalAppointment&&$scope.editAppointment(selectedSurgicalAppointment),getAvailableBlockDurationInHoursAndMinutesFormat(),response}):response})},getAppointmentDuration=function(surgicalAppointment){return surgicalAppointmentHelper.getAppointmentDuration(surgicalAppointment.surgicalAppointmentAttributes.estTimeHours.value,surgicalAppointment.surgicalAppointmentAttributes.estTimeMinutes.value,surgicalAppointment.surgicalAppointmentAttributes.cleaningTime.value)},getAvailableBlockDuration=function(){return surgicalBlockHelper.getAvailableBlockDuration($scope.surgicalForm)};$scope.getPatientName=function(surgicalAppointment){return surgicalAppointment.patient.value||surgicalAppointmentHelper.getPatientDisplayLabel(surgicalAppointment.patient.display)},$scope.editAppointment=function(surgicalAppointment){_.forEach($scope.surgicalForm.surgicalAppointments,function(surgicalAppointment){delete surgicalAppointment.isBeingEdited});var clone=_.cloneDeep(surgicalAppointment);surgicalAppointment.isBeingEdited=!0,$scope.addNewSurgicalAppointment(clone)},$scope.isFormValid=function(){return $scope.createSurgicalBlockForm.$valid&&$scope.isStartDatetimeBeforeEndDatetime($scope.surgicalForm.startDatetime,$scope.surgicalForm.endDatetime)},$scope.isStartDatetimeBeforeEndDatetime=function(startDate,endDate){return!startDate||!endDate||startDate<endDate},$scope.closeDialog=function(){ngDialog.close()},$scope.saveAnywaysFlag=!1,$scope.saveAnyways=function(surgicalForm){$scope.saveAnywaysFlag=!0,$scope.save(surgicalForm),ngDialog.close()},$scope.save=function(surgicalForm){if(!$scope.isFormValid())return void messagingService.showMessage("error","{{'OT_ENTER_MANDATORY_FIELDS' | translate}}");if(getAvailableBlockDuration()<0)return void messagingService.showMessage("error","{{'OT_SURGICAL_APPOINTMENT_EXCEEDS_BLOCK_DURATION' | translate}}");if($scope.saveAnywaysFlag||Bahmni.Common.Util.DateUtil.isSameDate(
|
||
|
},getOrderedOtsByLocation=function(otsOfDay){var orderedOts=[];return null!=$scope.locations&&(orderedOts=_.map(_.filter($scope.locations,function(location){return otsOfDay.includes(location.uuid)}),function(ot){return ot.uuid})),orderedOts},timer=$interval(updateCurrentDayTimeline,3e6);$scope.$on("$destroy",function(){$interval.cancel(timer)}),$scope.$watch("viewDate",function(newValue,oldValue){"day"===$scope.weekOrDay&&(Bahmni.Common.Util.DateUtil.isSameDate(oldValue,newValue)||spinner.forPromise(init()))}),$scope.$watch("weekStartDate",function(newValue,oldValue){"week"===$scope.weekOrDay&&(Bahmni.Common.Util.DateUtil.isSameDate(moment(oldValue).toDate(),moment(newValue).toDate())||spinner.forPromise(init()))}),spinner.forPromise(init())}]),angular.module("bahmni.ot").controller("surgicalAppointmentActualTimeController",["$scope","ngDialog","surgicalAppointmentService","messagingService","surgicalAppointmentHelper","$translate",function($scope,ngDialog,surgicalAppointmentService,messagingService,surgicalAppointmentHelper,$translate){var surgicalBlock=$scope.ngDialogData.surgicalBlock,surgicalAppointment=$scope.ngDialogData.surgicalAppointment,calculateActualEndTime=function(){var totalAppointmentsDuration=0,sortedAppointments=_.sortBy(surgicalBlock.surgicalAppointments,"sortWeight");_.find(sortedAppointments,function(appointment){return totalAppointmentsDuration+=surgicalAppointmentHelper.getEstimatedDurationForAppointment(appointment),appointment.id===surgicalAppointment.id});var appointmentEndTime=moment(surgicalBlock.startDatetime).toDate();return appointmentEndTime=Bahmni.Common.Util.DateUtil.addMinutes(appointmentEndTime,totalAppointmentsDuration)},init=function(){var calculatedAppointmentEndTime=calculateActualEndTime(),appointmentDuration=surgicalAppointmentHelper.getEstimatedDurationForAppointment(surgicalAppointment);$scope.actualStartTime=surgicalAppointment.actualStartDatetime&&moment(surgicalAppointment.actualStartDatetime).toDate()||Bahmni.Common.Util.DateUtil.subtractSeconds(calculatedAppointmentEndTime,60*appointmentDuration),$scope.actualEndTime=surgicalAppointment.actualEndDatetime&&moment(surgicalAppointment.actualEndDatetime).toDate()||calculatedAppointmentEndTime,$scope.notes=surgicalAppointment.notes,$scope.patientDisplayLabel=surgicalAppointmentHelper.getPatientDisplayLabel(surgicalAppointment.patient.display)};$scope.isStartDatetimeBeforeEndDatetime=function(startDate,endDate){return!startDate||!endDate||startDate<endDate},$scope.add=function(){if(!$scope.isStartDatetimeBeforeEndDatetime($scope.actualStartTime,$scope.actualEndTime))return void messagingService.showMessage("error","ACTUAL_START_TIME_GREATER_THAN_END_TIME_MESSAGE");var surgicalAppointment={};surgicalAppointment.id=$scope.ngDialogData.surgicalAppointment.id,surgicalAppointment.uuid=$scope.ngDialogData.surgicalAppointment.uuid,surgicalAppointment.actualStartDatetime=$scope.actualStartTime,surgicalAppointment.actualEndDatetime=$scope.actualEndTime,surgicalAppointment.status=$scope.actualStartTime&&Bahmni.OT.Constants.completed||Bahmni.OT.Constants.scheduled,surgicalAppointment.notes=$scope.notes,surgicalAppointment.surgicalBlock={uuid:$scope.ngDialogData.surgicalBlock.uuid},surgicalAppointment.patient={uuid:$scope.ngDialogData.surgicalAppointment.patient.uuid},surgicalAppointment.sortWeight=$scope.ngDialogData.surgicalAppointment.sortWeight,surgicalAppointmentService.updateSurgicalAppointment(surgicalAppointment).then(function(response){$scope.ngDialogData.surgicalAppointment.actualStartDatetime=response.data.actualStartDatetime,$scope.ngDialogData.surgicalAppointment.actualEndDatetime=response.data.actualEndDatetime,$scope.ngDialogData.surgicalAppointment.status=response.data.status,$scope.ngDialogData.surgicalAppointment.notes=response.data.notes;var message=$translate.instant("ACTUAL_TIME_ADDED_TO_KEY")+surgicalAppointmentHelper.getPatientDisplayLabel($scope.ngDialogData.surgicalAppointment.patient.display)+" - "+$scope.ngDialogData.surgicalBlock.location.name;messagingService.showMessage("info",message),ngDialog.close()})},$sco
|
||
|
loadOnDownArrow:"=",autoCompleteMinLength:"="},templateUrl:"../ot/views/multiSelectAutocomplete.html"}}]),angular.module("bahmni.ot").directive("stringToNumber",function(){return{require:"ngModel",link:function(scope,elem,attrs,ngModel){"number"===attrs.type&&ngModel.$formatters.push(function(value){return parseFloat(value)})}}}),angular.module("bahmni.ot").directive("listView",[function(){return{restrict:"E",controller:"listViewController",scope:{viewDate:"=",filterParams:"=",weekStartDate:"=",weekEndDate:"=",weekOrDay:"="},templateUrl:"../ot/views/listView.html"}}]),angular.module("bahmni.ot").directive("onScroll",[function(){var link=function($scope,$element,attrs){$element.bind("scroll",function(evt){$(".calendar-location").css("top",$element.scrollTop()),$(".calendar-time-container").css("left",$element.scrollLeft())})};return{restrict:"A",link:link}}]),Bahmni.OT.SurgicalBlockMapper=function(){var mapSelectedOtherSurgeon=function(otherSurgeonAttribute,surgeonList){var selectedOtherSurgeon=_.filter(surgeonList,function(surgeon){return surgeon.id===parseInt(otherSurgeonAttribute.value)});otherSurgeonAttribute.value=_.isEmpty(selectedOtherSurgeon)?null:selectedOtherSurgeon[0]},mapOpenMrsSurgicalAppointmentAttributes=function(openMrsSurgicalAppointmentAttributes,surgeonsList){var mappedAttributes={};_.each(openMrsSurgicalAppointmentAttributes,function(attribute){var attributeName=attribute.surgicalAppointmentAttributeType.name;mappedAttributes[attributeName]={id:attribute.id,uuid:attribute.uuid,value:attribute.value,surgicalAppointmentAttributeType:{uuid:attribute.surgicalAppointmentAttributeType.uuid,name:attribute.surgicalAppointmentAttributeType.name}}});var otherSurgeonnAttribute=mappedAttributes.otherSurgeon;return otherSurgeonnAttribute&&mapSelectedOtherSurgeon(otherSurgeonnAttribute,surgeonsList),mappedAttributes},mapSurgicalAppointment=function(openMrsSurgicalAppointment,attributeTypes,surgeonsList){var surgicalAppointmentAttributes=mapOpenMrsSurgicalAppointmentAttributes(openMrsSurgicalAppointment.surgicalAppointmentAttributes,surgeonsList);return{id:openMrsSurgicalAppointment.id,uuid:openMrsSurgicalAppointment.uuid,voided:openMrsSurgicalAppointment.voided||!1,patient:openMrsSurgicalAppointment.patient,sortWeight:openMrsSurgicalAppointment.sortWeight,actualStartDatetime:Bahmni.Common.Util.DateUtil.parseServerDateToDate(openMrsSurgicalAppointment.actualStartDatetime),actualEndDatetime:Bahmni.Common.Util.DateUtil.parseServerDateToDate(openMrsSurgicalAppointment.actualEndDatetime),notes:openMrsSurgicalAppointment.notes,status:openMrsSurgicalAppointment.status,bedLocation:openMrsSurgicalAppointment.bedLocation||"",bedNumber:openMrsSurgicalAppointment.bedNumber||"",surgicalAppointmentAttributes:(new Bahmni.OT.SurgicalBlockMapper).mapAttributes(surgicalAppointmentAttributes,attributeTypes)}};this.map=function(openMrsSurgicalBlock,attributeTypes,surgeonsList){var surgicalAppointments=_.map(openMrsSurgicalBlock.surgicalAppointments,function(surgicalAppointment){return mapSurgicalAppointment(surgicalAppointment,attributeTypes,surgeonsList)});return{id:openMrsSurgicalBlock.id,uuid:openMrsSurgicalBlock.uuid,voided:openMrsSurgicalBlock.voided||!1,startDatetime:Bahmni.Common.Util.DateUtil.parseServerDateToDate(openMrsSurgicalBlock.startDatetime),endDatetime:Bahmni.Common.Util.DateUtil.parseServerDateToDate(openMrsSurgicalBlock.endDatetime),provider:openMrsSurgicalBlock.provider,location:openMrsSurgicalBlock.location,surgicalAppointments:_.sortBy(surgicalAppointments,"sortWeight")}};var mapSurgicalAppointmentAttributesUIToDomain=function(appointmentAttributes){var attributes=_.cloneDeep(appointmentAttributes),otherSurgeon=attributes.otherSurgeon;return otherSurgeon.value=otherSurgeon.value&&otherSurgeon.value.id,_.values(attributes).filter(function(attribute){return!_.isUndefined(attribute.value)}).map(function(attribute){return attribute.value=!_.isNull(attribute.value)&&attribute.value.toString()||"",attribute})},mapSurgicalAppointmentUIToDomain=function(surgicalAppointmentUI){return{id:surgicalAppointmentUI.id,uuid:surgi
|