@openmrs/esm-patient-registration-app 4.0.2-pre.816 → 4.0.2-pre.818

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.
@@ -13,7 +13,7 @@ orphan modules 3.9 MiB [orphan] 631 modules
13
13
  runtime modules 38 KiB 28 modules
14
14
  built modules 3.57 MiB (javascript) 168 bytes (share-init) 168 bytes (consume-shared) [built]
15
15
  modules by path ../../node_modules/ 3.14 MiB 405 modules
16
- modules by path ./ 444 KiB 28 modules
16
+ modules by path ./ 445 KiB 28 modules
17
17
  provide-module modules 168 bytes
18
18
  provide shared module (default) @openmrs/esm-framework@4.0.3-pre.392 = ../../node_modules/@openmrs/esm-framework/src/internal.ts 42 bytes [built] [code generated]
19
19
  provide shared module (default) react-i18next@11.18.6 = ../../node_modules/react-i18next/dist/es/index.js 42 bytes [built] [code generated]
@@ -30,4 +30,4 @@ Assets:
30
30
  858.js (397 KiB)
31
31
  430.js (244 KiB)
32
32
 
33
- webpack 5.74.0 compiled with 1 warning in 64590 ms
33
+ webpack 5.74.0 compiled with 1 warning in 126369 ms
package/dist/574.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_openmrs_esm_patient_registration_app=self.webpackChunk_openmrs_esm_patient_registration_app||[]).push([[574],{3574:e=>{e.exports=JSON.parse('{"addRelationshipButtonText":"Add Relationship","address1":"Address line 1","address2":"Address line 2","addressHeader":"Address","allFieldsRequiredText":"All fields are required unless marked optional","autoGeneratedPlaceholderText":"Auto-generated","birthdayNotInTheFuture":"Birthday cannot be in the future","birthdayRequired":"Birthday is required","birthFieldLabelText":"Birth","cancel":"Cancel","causeOfDeathInputLabel":"Cause of Death","cityVillage":"City","configure":"Configure","country":"Country","countyDistrict":"District","createNew":"Create New","dateOfBirthLabelText":"Date of Birth","deathDateInputLabel":"Date of Death","deathdayNotInTheFuture":"Death day cannot be in the future","deleteIdentifierTooltip":"Delete","deleteRelationshipTooltipText":"Delete","discard":"Discard","discardModalBody":"The changes you made to this patient\'s details have not been saved. Discard changes?","discardModalHeader":"Confirm Discard Changes","dobToggleLabelText":"Date of Birth Known?","edit":"Edit","editIdentifierTooltip":"Edit","editPatientDetails":"Edit patient details","emailLabelText":"Email","estimatedAgeInMonthsLabelText":"Estimated age in months","estimatedAgeInYearsLabelText":"Estimated age in years","familyNameLabelText":"Family Name","familyNameRequired":"Family name is required","fieldErrorTitleMessage":"The following fields have errors:","fullNameLabelText":"Full Name","genderLabelText":"Sex","genderRequired":"Gender is required","genderUnspecified":"Gender is not specified","givenNameLabelText":"First Name","givenNameRequired":"Given name is required","identifierValueRequired":"Identifier value is required","idFieldLabelText":"Identifiers","incompleteForm":"Incomplete form","invalidEmail":"A valid email has to be given","invalidInput":"Invalid Input","isDeadInputLabel":"Is Dead","jumpTo":"Jump to","loadingResults":"Loading results","middleNameLabelText":"Middle Name","months":"Months","negativeMonths":"Negative months","negativeYears":"Negative years","no":"No","noResultsFound":"No results found","numberInNameDubious":"Number is name is dubious","optional":"optional","patient":"Patient","patientNameKnown":"Patient\'s Name is Known?","phoneEmailLabelText":"Phone, Email, etc.","phoneNumberInputLabelText":"Phone number","postalCode":"Postcode","registerPatient":"Register Patient","registrationSuccessToastDescription":"The patient can now be found by searching for them using their name or ID number","registrationSuccessToastTitle":"New Patient Created","relationship":"Relationship","relationshipPlaceholder":"Relationship","relationshipRemovedText":"Relationship removed","relationshipToPatient":"Relationship to patient","relativeFullNameLabelText":"Full name","relativeNamePlaceholder":"Firstname Familyname","resetIdentifierTooltip":"Reset","restoreRelationshipActionButton":"Undo","searchAddress":"Search address","sexFieldLabelText":"Sex","stateProvince":"State","stroke":"Stroke","unidentifiedPatient":"Unidentified Patient","unknown":"Unknown","updatePatient":"Update Patient","updationSuccessToastDescription":"The patient\'s information has been successfully updated","updationSuccessToastTitle":"Patient Details Updated","years":"Years","yearsEstimateRequired":"Years estimate required","yes":"Yes"}')}}]);
1
+ "use strict";(self.webpackChunk_openmrs_esm_patient_registration_app=self.webpackChunk_openmrs_esm_patient_registration_app||[]).push([[574],{3574:e=>{e.exports=JSON.parse('{"addRelationshipButtonText":"Add Relationship","address1":"Address line 1","address2":"Address line 2","addressHeader":"Address","allFieldsRequiredText":"All fields are required unless marked optional","autoGeneratedPlaceholderText":"Auto-generated","birthdayNotInTheFuture":"Birthday cannot be in the future","birthdayRequired":"Birthday is required","birthFieldLabelText":"Birth","cancel":"Cancel","causeOfDeathInputLabel":"Cause of Death","cityVillage":"City","configure":"Configure","country":"Country","countyDistrict":"District","createNew":"Create New","dateOfBirthLabelText":"Date of Birth","deathDateInputLabel":"Date of Death","deathdayNotInTheFuture":"Death day cannot be in the future","deleteIdentifierTooltip":"Delete","deleteRelationshipTooltipText":"Delete","discard":"Discard","discardModalBody":"The changes you made to this patient\'s details have not been saved. Discard changes?","discardModalHeader":"Confirm Discard Changes","dobToggleLabelText":"Date of Birth Known?","edit":"Edit","editIdentifierTooltip":"Edit","editPatientDetails":"Edit patient details","emailLabelText":"Email","estimatedAgeInMonthsLabelText":"Estimated age in months","estimatedAgeInYearsLabelText":"Estimated age in years","familyNameLabelText":"Family Name","familyNameRequired":"Family name is required","female":"Female","fieldErrorTitleMessage":"The following fields have errors:","fullNameLabelText":"Full Name","genderLabelText":"Sex","genderRequired":"Gender is required","genderUnspecified":"Gender is not specified","givenNameLabelText":"First Name","givenNameRequired":"Given name is required","identifierValueRequired":"Identifier value is required","idFieldLabelText":"Identifiers","incompleteForm":"Incomplete form","invalidEmail":"A valid email has to be given","invalidInput":"Invalid Input","isDeadInputLabel":"Is Dead","jumpTo":"Jump to","loadingResults":"Loading results","male":"Male","middleNameLabelText":"Middle Name","months":"Months","negativeMonths":"Negative months","negativeYears":"Negative years","no":"No","noResultsFound":"No results found","numberInNameDubious":"Number is name is dubious","optional":"optional","other":"Other","patient":"Patient","patientNameKnown":"Patient\'s Name is Known?","phoneEmailLabelText":"Phone, Email, etc.","phoneNumberInputLabelText":"Phone number","postalCode":"Postcode","registerPatient":"Register Patient","registrationSuccessToastDescription":"The patient can now be found by searching for them using their name or ID number","registrationSuccessToastTitle":"New Patient Created","relationship":"Relationship","relationshipPlaceholder":"Relationship","relationshipRemovedText":"Relationship removed","relationshipToPatient":"Relationship to patient","relativeFullNameLabelText":"Full name","relativeNamePlaceholder":"Firstname Familyname","resetIdentifierTooltip":"Reset","restoreRelationshipActionButton":"Undo","searchAddress":"Search address","sexFieldLabelText":"Sex","stateProvince":"State","stroke":"Stroke","unidentifiedPatient":"Unidentified Patient","unknown":"Unknown","updatePatient":"Update Patient","updationSuccessToastDescription":"The patient\'s information has been successfully updated","updationSuccessToastTitle":"Patient Details Updated","years":"Years","yearsEstimateRequired":"Years estimate required","yes":"Yes"}')}}]);
package/dist/686.js CHANGED
@@ -1 +1 @@
1
- (self.webpackChunk_openmrs_esm_patient_registration_app=self.webpackChunk_openmrs_esm_patient_registration_app||[]).push([[686],{225:(e,t,n)=>{"use strict";n.d(t,{X8:()=>s,bT:()=>u,bs:()=>o});var i=n(906);function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function a(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var o=[{id:"demographics",name:"Basic Info",fields:["name","gender","dob","id"]},{id:"contact",name:"Contact Details",fields:["address","phone & email"]},{id:"death",name:"Death Info",fields:[]},{id:"relationships",name:"Relationships",fields:[]}],s=["name","gender","dob","address","id","phone & email"],u={sections:{_type:i.Type.Array,_default:["demographics","contact","relationships"],_description:"An array of strings which are the keys from 'sectionDefinitions' or any of the following built-in sections: '".concat(o.map((function(e){return e.id})).join("', '"),"'."),_elements:{_type:i.Type.String}},sectionDefinitions:{_type:i.Type.Array,_elements:{id:{_type:i.Type.String,_description:"How this section will be referred to in the `sections` configuration. To override a built-in section, use that section's id. The built in section ids are '".concat(o.map((function(e){return e.id})).join("', '"),"'.")},name:{_type:i.Type.String,_description:"The title to display at the top of the section."},fields:{_type:i.Type.Array,_default:[],_description:"The parts to include in the section. Can be any of the following built-in fields: ".concat(s.join(", "),". Can also be an id from an object in the `fieldDefinitions` array, which you can use to define custom fields."),_elements:{_type:i.Type.String}}},_default:[]},fieldDefinitions:{_type:i.Type.Array,_elements:{id:{_type:i.Type.String,_description:"How this field will be referred to in the `fields` element of the `sectionDefinitions` configuration."},type:{_type:i.Type.String,_description:"How this field's data will be stored—a person attribute or an obs."},uuid:{_type:i.Type.UUID,_description:"Person attribute type UUID that this field's data should be saved to."},label:{_type:i.Type.String,_default:null,_description:"The label of the input. By default, uses the metadata `display` attribute."},placeholder:{_type:i.Type.String,_default:"",_description:"Placeholder that will appear in the input."},validation:{required:{_type:i.Type.Boolean,_default:!1},matches:{_type:i.Type.String,_default:null,_description:"Optional RegEx for testing the validity of the input."}},answerConceptSetUuid:{_type:i.Type.ConceptUuid,_default:null,_description:"For coded questions only. A concept which has the possible responses either as answers or as set members."},customConceptAnswers:{_type:i.Type.Array,_elements:{uuid:{_type:i.Type.UUID,_description:"Answer concept UUID"},label:{_type:i.Type.String,_default:null,_description:"The custom label for the answer concept."}},_default:[],_description:"For coded questions only. Provide ability to add custom concept answers."}},_default:[],_description:"Definitions for custom fields that can be used in sectionDefinitions. Can also be used to override built-in fields."},fieldConfigurations:{name:{displayMiddleName:{_type:i.Type.Boolean,_default:!0},unidentifiedPatient:{_type:i.Type.Boolean,_default:!0,_description:"Whether to allow patients to be registered without names."},defaultUnknownGivenName:{_type:i.Type.String,_default:"UNKNOWN",_description:"The given/first name to record for unidentified patients."},defaultUnknownFamilyName:{_type:i.Type.String,_default:"UNKNOWN",_description:"The family/last name to record for unidentified patients."},displayCapturePhoto:{_type:i.Type.Boolean,_default:!0,_description:"Whether to display capture patient photo slot on name field"}},gender:{_type:i.Type.Array,_elements:{value:{_type:i.Type.String,_description:"The value for sex option"},label:{_type:i.Type.String,_default:null,_description:"The label displayed for sex option."},id:{_type:i.Type.String,_default:null,_description:"The id for sex option."}},_default:[{id:"male",value:"Male",label:"Male"},{id:"female",value:"Female",label:"Female"},{id:"other",value:"Other",label:"Other"},{id:"unknown",value:"Unknown",label:"Unknown"}],_description:"Provide ability to configure sex options."},address:{useAddressHierarchy:{enabled:{_type:i.Type.Boolean,_description:"Whether to use the Address hierarchy in the registration form or not",_default:!0},useQuickSearch:{_type:i.Type.Boolean,_description:"Whether to use the quick searching through the address saved in the database pre-fill the form.",_default:!0},searchAddressByLevel:{_type:i.Type.Boolean,_description:"Whether to fill the addresses by levels, i.e. County => subCounty, the current field is dependent on it's previous field.",_default:!0},useAddressHierarchyLabel:{_type:i.Type.Object,_description:"Whether to use custom labels for address hierarchy",_default:{}}}},dateOfBirth:{useEstimatedDateOfBirth:{enabled:{_type:i.Type.Boolean,_description:"Whether to use custom day and month for estimated date of birth",_default:!1},dayOfMonth:{_type:i.Type.Number,_description:"The custom day of the month use on the estimated date of birth",_default:0},month:{_type:i.Type.Number,_description:"The custom month to use on the estimated date of birth i.e 0 = Jan 11 = Dec",_default:0}}}},links:{submitButton:{_type:i.Type.String,_default:"${openmrsSpaBase}/patient/${patientUuid}/chart",_validators:[i.validators.isUrlWithTemplateParameters(["patientUuid"])]}},concepts:{patientPhotoUuid:{_type:i.Type.ConceptUuid,_default:"736e8771-e501-4615-bfa7-570c03f4bef5"}},defaultPatientIdentifierTypes:{_type:i.Type.Array,_elements:{_type:i.Type.PatientIdentifierTypeUuid},_default:[]},registrationObs:{encounterTypeUuid:{_type:i.Type.UUID,_default:null,_description:"Obs created during registration will be associated with an encounter of this type. This must be set in order to use fields of type `obs`."},encounterProviderRoleUuid:{_type:i.Type.UUID,_default:"a0b03050-c99b-11e0-9572-0800200c9a66",_description:"The provider role to use for the registration encounter. Default is 'Unkown'."},registrationFormUuid:{_type:i.Type.UUID,_default:null,_description:"The form UUID to associate with the registration encounter. By default no form will be associated."}},_validators:[(0,i.validator)((function(e){return!e.fieldDefinitions.some((function(e){return"obs"==e.type}))||null!=e.registrationObs.encounterTypeUuid}),"If fieldDefinitions contains any fields of type 'obs', `registrationObs.encounterTypeUuid` must be specified."),(0,i.validator)((function(e){return e.sections.every((function(t){return a(o).concat(a(e.sectionDefinitions)).map((function(e){return e.id})).includes(t)}))}),(function(e){var t=a(o).concat(a(e.sectionDefinitions)).map((function(e){return e.id})),n=e.sections.find((function(e){return!t.includes(e)}));return"'".concat(n,"' is not a valid section ID. Valid section IDs include the built-in sections ").concat(l(o))+(e.sectionDefinitions.length?"; and the defined sections ".concat(l(e.sectionDefinitions),"."):".")})),(0,i.validator)((function(e){return e.sectionDefinitions.every((function(t){return t.fields.every((function(t){return a(s).concat(a(e.fieldDefinitions.map((function(e){return e.id})))).includes(t)}))}))}),(function(e){var t=a(s).concat(a(e.fieldDefinitions.map((function(e){return e.id})))),n=e.sectionDefinitions.find((function(e){return e.fields.some((function(e){return!t.includes(e)}))})),i=n.fields.find((function(e){return!t.includes(e)}));return"The section definition '".concat(n.id,"' contains an invalid field '").concat(i,"'. 'fields' can only contain the built-in fields '").concat(s.join("', '"),"'")+(e.fieldDefinitions.length?"; or the defined fields ".concat(l(e.fieldDefinitions),"."):".")}))]};function l(e){return"'".concat(e.map((function(e){return e.id})).join("', '"),"'")}},8179:(e,t,n)=>{"use strict";n.d(t,{Kt:()=>l,QT:()=>c,UO:()=>s,e1:()=>u});var i,r,a,o=n(906),s="custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))",u="@openmrs/esm-patient-registration-app",l="patient-registration",c=(i={},a="network-first",(r=o.omrsOfflineCachingStrategyHttpHeaderName)in i?Object.defineProperty(i,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[r]=a,i)},1686:(e,t,n)=>{"use strict";n.r(t),n.d(t,{backendDependencies:()=>v,importTranslation:()=>b,setupOpenMRS:()=>g,version:()=>m});var i=n(906),r=n(3076),a=n(225),o=n(8179),s=n(6279);function u(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var a=e.apply(t,n);function o(e){u(a,i,r,o,s,"next",e)}function s(e){u(a,i,r,o,s,"throw",e)}o(void 0)}))}}var c=function(e,t){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};function d(e){return["/ws/fhir2/R4/Patient/".concat(e),"/ws/rest/v1/relationship?v=".concat(o.UO,"&person=").concat(e),"/ws/rest/v1/person/".concat(e,"/attribute"),"/ws/rest/v1/patient/".concat(e,"/identifier?v=custom:(uuid,identifier,identifierType:(uuid,required,name),preferred)")].map((function(e){return window.origin+(0,i.makeUrl)(e)}))}function f(){return p.apply(this,arguments)}function p(){return(p=l((function(){return c(this,(function(e){switch(e.label){case 0:return[4,Promise.all([(0,s.X1)(),(0,s.Te)(),(0,s.mt)(),(0,s.St)()])];case 1:return e.sent(),[2]}}))}))).apply(this,arguments)}function h(e,t){return y.apply(this,arguments)}function y(){return(y=l((function(e,t){return c(this,(function(n){switch(n.label){case 0:return[4,r.y.savePatientFormOnline(e._patientRegistrationData.isNewPatient,e._patientRegistrationData.formValues,e._patientRegistrationData.patientUuidMap,e._patientRegistrationData.initialAddressFieldValues,e._patientRegistrationData.capturePhotoProps,e._patientRegistrationData.currentLocation,e._patientRegistrationData.initialIdentifierValues,e._patientRegistrationData.currentUser,e._patientRegistrationData.config,e._patientRegistrationData.savePatientTransactionManager,t.abort)];case 1:return n.sent(),[2]}}))}))).apply(this,arguments)}var m="4.0.2-pre.816",b=n(3979),v={"webservices.rest":"^2.24.0"};function g(){var e={featureName:"Patient Registration",moduleName:o.e1};return(0,i.defineConfigSchema)(o.e1,a.bT),(0,i.registerBreadcrumbs)([{path:"".concat(window.spaBase,"/").concat(o.Kt),title:"Patient Registration",parent:"".concat(window.spaBase,"/home")},{path:"".concat(window.spaBase,"/patient/:patientUuid/edit"),title:"Edit patient details",parent:"".concat(window.spaBase,"/patient/:patientUuid/chart")}]),(0,i.setupOfflineSync)(o.Kt,[],h,{onBeginEditSyncItem:function(e){(0,i.navigate)({to:"${openmrsSpaBase}/patient/".concat(e.content.fhirPatient.id,"/edit")})}}),(0,i.subscribePrecacheStaticDependencies)(f),(0,i.setupDynamicOfflineDataHandler)({id:"esm-patient-registration-app:patient",type:"patient",displayName:"Patient registration",isSynced:function(e){return l((function(){var t,n;return c(this,(function(i){switch(i.label){case 0:return t=d(e),[4,caches.open("omrs-spa-cache-v1")];case 1:return[4,i.sent().keys()];case 2:return n=i.sent().map((function(e){return e.url})),[2,t.every((function(e){return n.includes(e)}))]}}))}))()},sync:function(e){return l((function(){var t;return c(this,(function(n){switch(n.label){case 0:return t=d(e),[4,Promise.allSettled(t.map((r=l((function(e){return c(this,(function(t){switch(t.label){case 0:return[4,(0,i.messageOmrsServiceWorker)({type:"registerDynamicRoute",url:e})];case 1:return t.sent(),[4,fetch(e)];case 2:return t.sent(),[2]}}))})),function(e){return r.apply(this,arguments)})))];case 1:return n.sent(),[2]}var r}))}))()}}),{pages:[{load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(430),n.e(375),n.e(154),n.e(924),n.e(658)]).then(n.bind(n,7658))}),e),route:"patient-registration",online:{savePatientForm:r.y.savePatientFormOnline,isOffline:!1},offline:{savePatientForm:r.y.savePatientFormOffline,isOffline:!0}},{load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(430),n.e(375),n.e(154),n.e(924),n.e(658)]).then(n.bind(n,7658))}),{featureName:"edit-patient-details-form",moduleName:o.e1}),route:/patient\/([a-zA-Z0-9\-]+)\/edit/,online:{savePatientForm:r.y.savePatientFormOnline},offline:{savePatientForm:r.y.savePatientFormOffline}}],extensions:[{id:"add-patient-action",slot:"top-nav-actions-slot",load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(430),n.e(375),n.e(206)]).then(n.bind(n,8206))}),e),online:!0,offline:!0},{id:"cancel-patient-edit-modal",load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(430),n.e(924),n.e(735)]).then(n.bind(n,5735))}),e),online:!0,offline:!0},{id:"patient-photo-widget",slot:"patient-photo-slot",load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(854),n.e(975)]).then(n.bind(n,9975))}),e),online:!0,offline:!0},{id:"edit-patient-details-button",slot:"patient-actions-slot",load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(924),n.e(635)]).then(n.bind(n,2635))}),e),online:!0,offline:!0},{id:"edit-patient-details-button",slot:"patient-search-actions-slot",load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(924),n.e(635)]).then(n.bind(n,2635))}),e),online:!0,offline:!0},{id:"delete-identifier-confirmation-modal",load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(430),n.e(924),n.e(242)]).then(n.bind(n,5242))}),e),online:!0,offline:!0}]}}},6279:(e,t,n)=>{"use strict";n.d(t,{Cg:()=>g,St:()=>D,Te:()=>T,X1:()=>w,mt:()=>O});var i=n(268),r=n.n(i),a=n(3662),o=n(2777),s=n(8407),u=n(906),l=n(8179);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function d(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function f(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var a=e.apply(t,n);function o(e){d(a,i,r,o,s,"next",e)}function s(e){d(a,i,r,o,s,"throw",e)}o(void 0)}))}}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){p(e,t,n[t])}))}return e}function y(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n.push.apply(n,i)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var b=function(e,t){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},v=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},g=r().createContext(null);function w(e){return _.apply(this,arguments)}function _(){return(_=f((function(e){return b(this,(function(t){switch(t.label){case 0:return[4,C("/ws/rest/v1/session",e)];case 1:return[2,t.sent().data]}}))}))).apply(this,arguments)}function T(e){return P.apply(this,arguments)}function P(){return(P=f((function(e){return b(this,(function(t){switch(t.label){case 0:return[4,C("/ws/rest/v1/systemsetting?q=layout.address.format&v=custom:(value)",e)];case 1:return[2,t.sent().data]}}))}))).apply(this,arguments)}function O(e){return S.apply(this,arguments)}function S(){return(S=f((function(e){return b(this,(function(t){switch(t.label){case 0:return[4,C("/ws/rest/v1/relationshiptype?v=default",e)];case 1:return[2,t.sent().data]}}))}))).apply(this,arguments)}function D(e){return U.apply(this,arguments)}function U(){return(U=f((function(e){var t,n,i,r,o,s,u,l,c;return b(this,(function(d){switch(d.label){case 0:return[4,j(e)];case 1:t=d.sent(),n=t.filter(Boolean),i=!0,r=!1,o=void 0,d.label=2;case 2:d.trys.push([2,7,8,9]),s=function(){var t,n,i,r;return b(this,(function(o){switch(o.label){case 0:return t=l.value,[4,Promise.all([k(t.uuid,e),F(e)])];case 1:return n=m.apply(void 0,[o.sent(),2]),i=n[0],r=n[1],t.identifierSources=i.data.results.map((function(e){var t=(0,a.Z)(r.data.results,{source:{uuid:e.uuid}});return e.autoGenerationOption=t,e})),[2]}}))},u=n[Symbol.iterator](),d.label=3;case 3:return(i=(l=u.next()).done)?[3,6]:[5,v(s())];case 4:d.sent(),d.label=5;case 5:return i=!0,[3,3];case 6:return[3,9];case 7:return c=d.sent(),r=!0,o=c,[3,9];case 8:try{i||null==u.return||u.return()}finally{if(r)throw o}return[7];case 9:return[2,n]}}))}))).apply(this,arguments)}function j(e){return A.apply(this,arguments)}function A(){return(A=f((function(e){var t,n,i,r,a,s,u,l,c;return b(this,(function(d){switch(d.label){case 0:return[4,C("/ws/rest/v1/patientidentifiertype?v=full",e)];case 1:return t=d.sent(),[4,C("/ws/rest/v1/metadatamapping/termmapping?v=full&code=emr.primaryIdentifierType",e)];case 2:return n=d.sent(),t.ok?(u=null==t||null===(i=t.data)||void 0===i?void 0:i.results,l=null==n||null===(r=n.data)||void 0===r||null===(a=r.results)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.metadataUuid,c=(null==n?void 0:n.ok)?[B(null==u?void 0:u.find((function(e){return e.uuid===l})),!0)]:[],u.forEach((function(e){e.uuid!==l&&c.push(B(e,!1))})),[2,c.map((function(e){return y(h({},e),{fieldName:(0,o.Z)(e.name)})}))]):[2,[]]}}))}))).apply(this,arguments)}function k(e,t){return N.apply(this,arguments)}function N(){return(N=f((function(e,t){return b(this,(function(n){switch(n.label){case 0:return[4,C("/ws/rest/v1/idgen/identifiersource?v=default&identifierType=".concat(e),t)];case 1:return[2,n.sent()]}}))}))).apply(this,arguments)}function F(e){return I.apply(this,arguments)}function I(){return(I=f((function(e){return b(this,(function(t){switch(t.label){case 0:return[4,C("/ws/rest/v1/idgen/autogenerationoption?v=full",e)];case 1:return[2,t.sent()]}}))}))).apply(this,arguments)}function C(e,t){return E.apply(this,arguments)}function E(){return(E=f((function(e,t){return b(this,(function(n){switch(n.label){case 0:return[4,(0,u.messageOmrsServiceWorker)({type:"registerDynamicRoute",pattern:(0,s.Z)(e)})];case 1:return n.sent(),[4,(0,u.openmrsFetch)(e,{headers:l.QT,signal:null==t?void 0:t.signal})];case 2:return[2,n.sent()]}}))}))).apply(this,arguments)}function B(e,t){return{name:e.display,fieldName:(0,o.Z)(e.display),required:e.required,uuid:e.uuid,format:e.format,isPrimary:t,uniquenessBehavior:e.uniquenessBehavior}}},3076:(e,t,n)=>{"use strict";n.d(t,{I:()=>m,y:()=>y});var i=n(906),r=n(8179),a=n(7117);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function s(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var a=e.apply(t,n);function o(e){s(a,i,r,o,u,"next",e)}function u(e){s(a,i,r,o,u,"throw",e)}o(void 0)}))}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){c(e,t,n[t])}))}return e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var p,h=function(e,t){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},y=function(){function e(){l(this,e)}return e.saveRelationships=function(e,t,n){return u((function(){return h(this,(function(i){return[2,Promise.all(e.filter((function(e){return e.relationshipType})).filter((function(e){return!!e.action})).map((function(e){var i=e.relatedPersonUuid,r=e.relationshipType,o=e.uuid,s=e.action,u=f(r.split("/"),2),l=u[0],c=u[1],d=t.data.uuid,p="aIsToB"===c,h={personA:p?i:d,personB:p?d:i,relationshipType:l};switch(s){case"ADD":return(0,a.bL)(n,h);case"UPDATE":return(0,a.r6)(n,o,h);case"DELETE":return(0,a.kE)(n,o)}})))]}))}))()},e.saveObservations=function(e,t,n,i,r,o){return u((function(){var s;return h(this,(function(u){if(e&&Object.keys(e).length>0){if(r.registrationObs.encounterTypeUuid)return s={encounterDatetime:new Date,patient:t.data.uuid,encounterType:r.registrationObs.encounterTypeUuid,location:n,encounterProviders:[{provider:i.currentProvider.uuid,encounterRole:r.registrationObs.encounterProviderRoleUuid}],form:r.registrationObs.registrationFormUuid,obs:Object.keys(e).map((function(t){return{concept:t,value:e[t]}}))},[2,(0,a.M1)(o,s)];console.error("The registration form has been configured to have obs fields, but no registration encounter type has been configured. Obs field values will not be saved.")}return[2]}))}))()},e.savePatientIdentifiers=function(e,t,n,i,r,o){return u((function(){var s;return h(this,(function(l){var c;return s=Object.values(n).map((c=u((function(n){var i,s,u,l,c,d,f,p,y,m;return h(this,(function(h){switch(h.label){case 0:return i=n.identifierTypeUuid,s=n.identifierValue,u=n.identifierUuid,l=n.selectedSource,c=n.preferred,d=n.autoGeneration,f=n.initialValue,s||d&&l?d?[3,1]:(y=s,[3,4]):[3,9];case 1:return[4,(0,a.fX)(n.selectedSource.uuid,o)];case 2:return[4,h.sent().data.identifier];case 3:y=h.sent(),h.label=4;case 4:return m={uuid:u,identifier:p=y,identifierType:i,location:r,preferred:c},e?[3,8]:f?[3,6]:[4,(0,a.eb)(t,m,o)];case 5:return h.sent(),[3,8];case 6:return f===p?[3,8]:[4,(0,a.nI)(t,u,m.identifier,o)];case 7:h.sent(),h.label=8;case 8:return[2,m];case 9:return[2]}}))})),function(e){return c.apply(this,arguments)})),t&&Object.keys(i).filter((function(e){return!n[e]})).forEach(function(){var e=u((function(e){return h(this,(function(n){switch(n.label){case 0:return[4,(0,a.ZB)(t,i[e].identifierUuid,o)];case 1:return n.sent(),[2]}}))}));return function(t){return e.apply(this,arguments)}}()),[2,Promise.all(s)]}))}))()},e.getDeletedNames=function(e,t){return(null==t?void 0:t.additionalNameUuid)?[{nameUuid:t.additionalNameUuid,personUuid:e}]:[]},e.getPatientToCreate=function(t,n,i,r){var a,o,s;return o=t.birthdate,a=(null!=(s=Date)&&"undefined"!=typeof Symbol&&s[Symbol.hasInstance]?s[Symbol.hasInstance](o):o instanceof s)?[t.birthdate.getFullYear(),t.birthdate.getMonth()+1,t.birthdate.getDate()].join("-"):t.birthdate,{uuid:t.patientUuid,person:d({uuid:t.patientUuid,names:e.getNames(t,n),gender:t.gender.charAt(0),birthdate:a,birthdateEstimated:t.birthdateEstimated,attributes:e.getPatientAttributes(t),addresses:[t.address]},e.getPatientDeathInfo(t)),identifiers:r}},e.getNames=function(e,t){var n=[{uuid:t.preferredNameUuid,preferred:!0,givenName:e.givenName,middleName:e.middleName,familyName:e.familyName}];return e.addNameInLocalLanguage&&n.push({uuid:t.additionalNameUuid,preferred:!1,givenName:e.additionalGivenName,middleName:e.additionalMiddleName,familyName:e.additionalFamilyName}),n},e.getPatientAttributes=function(e){var t=[];if(e.attributes){var n=!0,i=!1,r=void 0;try{for(var a,o=Object.entries(e.attributes)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=f(a.value,2),u=s[0],l=s[1];t.push({attributeType:u,value:l})}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return e.unidentifiedPatient&&t.push({attributeType:"8b56eac7-5c76-4b9c-8c6f-1deab8d3fc47",value:"true"}),t},e.getPatientDeathInfo=function(e){var t=e.isDead,n=e.deathDate,i=e.deathCause;return{dead:t,deathDate:t?n:void 0,causeOfDeath:t?i:void 0}},e.mapPatientToFhirPatient=function(e){var t,n,i,r,a,o;return{id:e.uuid,gender:{M:"male",F:"female",O:"other",U:"unknown"}[null===(t=e.person)||void 0===t?void 0:t.gender],birthDate:null===(n=e.person)||void 0===n?void 0:n.birthdate,deceasedBoolean:e.person.dead,deceasedDateTime:e.person.deathDate,name:null===(i=e.person)||void 0===i||null===(r=i.names)||void 0===r?void 0:r.map((function(e){return{given:[e.givenName,e.middleName].filter(Boolean),family:e.familyName}})),address:null===(a=e.person)||void 0===a?void 0:a.addresses.map((function(e){return{city:e.cityVillage,country:e.country,postalCode:e.postalCode,state:e.stateProvince,use:"home"}})),telecom:null===(o=e.person.attributes)||void 0===o?void 0:o.filter((function(e){return"Telephone Number"===e.attributeType}))}},e}();y.savePatientFormOffline=(p=u((function(e,t,n,a,o,s,u,l,c){var d;return h(this,(function(f){switch(f.label){case 0:return d={fhirPatient:y.mapPatientToFhirPatient(y.getPatientToCreate(t,n,a,[])),_patientRegistrationData:{isNewPatient:e,formValues:t,patientUuidMap:n,initialAddressFieldValues:a,capturePhotoProps:o,currentLocation:s,initialIdentifierValues:u,currentUser:l,config:c,savePatientTransactionManager:new m}},[4,(0,i.queueSynchronizationItem)(r.Kt,d,{id:t.patientUuid,displayName:"Patient registration",patientUuid:d.fhirPatient.id,dependencies:[]})];case 1:return f.sent(),[2,null]}}))})),function(e,t,n,i,r,a,o,s,u){return p.apply(this,arguments)}),y.savePatientFormOnline=function(){var e=u((function(e,t,n,i,r,o,s,l,c,d,f){var p,m,b;return h(this,(function(v){switch(v.label){case 0:return[4,y.savePatientIdentifiers(e,t.patientUuid,t.identifiers,s,o,f)];case 1:return p=v.sent(),m=y.getPatientToCreate(t,n,i,p),y.getDeletedNames(t.patientUuid,n).forEach(function(){var e=u((function(e){return h(this,(function(t){switch(t.label){case 0:return[4,(0,a.uO)(e.nameUuid,e.personUuid,f)];case 1:return t.sent(),[2]}}))}));return function(t){return e.apply(this,arguments)}}()),[4,(0,a.co)(f,m,e&&!d.patientSaved?void 0:t.patientUuid)];case 2:return(b=v.sent()).ok?(d.patientSaved=!0,[4,y.saveRelationships(t.relationships,b,f)]):[3,6];case 3:return v.sent(),[4,y.saveObservations(t.obs,b,o,l,c,f)];case 4:return v.sent(),c.concepts.patientPhotoUuid&&(null==r?void 0:r.imageData)?[4,(0,a.oV)(b.data.uuid,r.imageData,"/ws/rest/v1/obs",r.dateTime||(new Date).toISOString(),c.concepts.patientPhotoUuid,f)]:[3,6];case 5:v.sent(),v.label=6;case 6:return[2,b.data.uuid]}}))}));return function(t,n,i,r,a,o,s,u,l,c,d){return e.apply(this,arguments)}}();var m=function e(){l(this,e),this.patientSaved=!1}},7117:(e,t,n)=>{"use strict";n.d(t,{M1:()=>f,M8:()=>_,Uu:()=>w,ZB:()=>U,bL:()=>y,co:()=>d,eb:()=>P,f$:()=>A,fX:()=>p,kE:()=>b,nI:()=>S,oV:()=>v,r6:()=>m,uO:()=>h});var i=n(9857),r=n(2303),a=n(906),o=n(268);function s(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var a=e.apply(t,n);function o(e){s(a,i,r,o,u,"next",e)}function u(e){s(a,i,r,o,u,"throw",e)}o(void 0)}))}}var l=function(e,t){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};function c(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],i=new Uint8Array(t.length),r=0;r<t.length;r++)i[r]=t.charCodeAt(r);var a=new Blob([i],{type:n});return new File([a],"patient-photo.png")}function d(e,t,n){return(0,a.openmrsFetch)("/ws/rest/v1/patient/".concat(n||""),{headers:{"Content-Type":"application/json"},method:"POST",body:t,signal:e.signal})}function f(e,t){return(0,a.openmrsFetch)("/ws/rest/v1/encounter",{headers:{"Content-Type":"application/json"},method:"POST",body:t,signal:e.signal})}function p(e,t){return(0,a.openmrsFetch)("/ws/rest/v1/idgen/identifiersource/".concat(e,"/identifier"),{headers:{"Content-Type":"application/json"},method:"POST",body:{},signal:t.signal})}function h(e,t,n){return(0,a.openmrsFetch)("/ws/rest/v1/person/".concat(t,"/name/").concat(e),{method:"DELETE",signal:n.signal})}function y(e,t){return(0,a.openmrsFetch)("/ws/rest/v1/relationship",{headers:{"Content-Type":"application/json"},method:"POST",body:t,signal:e.signal})}function m(e,t,n){return(0,a.openmrsFetch)("/ws/rest/v1/relationship/".concat(t),{headers:{"Content-Type":"application/json"},method:"POST",body:{relationshipType:n.relationshipType},signal:e.signal})}function b(e,t){return(0,a.openmrsFetch)("/ws/rest/v1/relationship/".concat(t),{headers:{"Content-Type":"application/json"},method:"DELETE",signal:e.signal})}function v(e,t,n,i,r,a){return g.apply(this,arguments)}function g(){return(g=u((function(e,t,n,i,r,o){var s;return l(this,(function(u){return(s=new FormData).append("patient",e),s.append("file",c(t)),s.append("json",JSON.stringify({person:e,concept:r,groupMembers:[],obsDatetime:i})),[2,(0,a.openmrsFetch)(n,{method:"POST",signal:o.signal,body:s})]}))}))).apply(this,arguments)}function w(e){var t,n,r,o=(0,a.useConfig)().concepts.patientPhotoUuid,s="/ws/rest/v1/obs?patient=".concat(e,"&concept=").concat(o,"&v=full"),u=(0,i.ZP)(e?s:null,a.openmrsFetch),l=u.data,c=u.error,d=null==l||null===(t=l.data)||void 0===t?void 0:t.results[0];return{data:d?{dateTime:null==d?void 0:d.obsDatetime,imageSrc:null==d||null===(n=d.value)||void 0===n||null===(r=n.links)||void 0===r?void 0:r.uri}:null,isError:c,isLoading:!l&&!c}}function _(e,t){return T.apply(this,arguments)}function T(){return(T=u((function(e,t){return l(this,(function(n){return[2,(0,a.openmrsFetch)("/ws/rest/v1/person?q=".concat(e),{signal:t.signal})]}))}))).apply(this,arguments)}function P(e,t,n){return O.apply(this,arguments)}function O(){return(O=u((function(e,t,n){return l(this,(function(i){return[2,(0,a.openmrsFetch)("/ws/rest/v1/patient/".concat(e,"/identifier/"),{method:"POST",headers:{"Content-Type":"application/json"},signal:n.signal,body:t})]}))}))).apply(this,arguments)}function S(e,t,n,i){return D.apply(this,arguments)}function D(){return(D=u((function(e,t,n,i){return l(this,(function(r){return[2,(0,a.openmrsFetch)("/ws/rest/v1/patient/".concat(e,"/identifier/").concat(t),{method:"POST",headers:{"Content-Type":"application/json"},signal:i.signal,body:{identifier:n}})]}))}))).apply(this,arguments)}function U(e,t,n){return j.apply(this,arguments)}function j(){return(j=u((function(e,t,n){return l(this,(function(i){return[2,(0,a.openmrsFetch)("/ws/rest/v1/patient/".concat(e,"/identifier/").concat(t,"?purge"),{method:"DELETE",headers:{"Content-Type":"application/json"},signal:n.signal})]}))}))).apply(this,arguments)}function A(e,t){var n,i=(0,r.Z)(e?"/module/addresshierarchy/ajax/getPossibleFullAddresses.form?separator=".concat(t,"&searchString=").concat(e):null,a.openmrsFetch),s=i.data,u=i.error,l=(0,o.useMemo)((function(){var e;return{addresses:null!==(n=null==s||null===(e=s.data)||void 0===e?void 0:e.map((function(e){return e.address})))&&void 0!==n?n:[],error:u,isLoading:!s&&!u}}),[s,u]);return l}},3979:(e,t,n)=>{var i={"./en.json":[3574,574],"./km.json":[7807,807]};function r(e){if(!n.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],r=t[0];return n.e(t[1]).then((()=>n(r)))}r.keys=()=>Object.keys(i),r.id=3979,e.exports=r}}]);
1
+ (self.webpackChunk_openmrs_esm_patient_registration_app=self.webpackChunk_openmrs_esm_patient_registration_app||[]).push([[686],{225:(e,t,n)=>{"use strict";n.d(t,{X8:()=>s,bT:()=>u,bs:()=>o});var i=n(906);function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function a(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var o=[{id:"demographics",name:"Basic Info",fields:["name","gender","dob","id"]},{id:"contact",name:"Contact Details",fields:["address","phone & email"]},{id:"death",name:"Death Info",fields:[]},{id:"relationships",name:"Relationships",fields:[]}],s=["name","gender","dob","address","id","phone & email"],u={sections:{_type:i.Type.Array,_default:["demographics","contact","relationships"],_description:"An array of strings which are the keys from 'sectionDefinitions' or any of the following built-in sections: '".concat(o.map((function(e){return e.id})).join("', '"),"'."),_elements:{_type:i.Type.String}},sectionDefinitions:{_type:i.Type.Array,_elements:{id:{_type:i.Type.String,_description:"How this section will be referred to in the `sections` configuration. To override a built-in section, use that section's id. The built in section ids are '".concat(o.map((function(e){return e.id})).join("', '"),"'.")},name:{_type:i.Type.String,_description:"The title to display at the top of the section."},fields:{_type:i.Type.Array,_default:[],_description:"The parts to include in the section. Can be any of the following built-in fields: ".concat(s.join(", "),". Can also be an id from an object in the `fieldDefinitions` array, which you can use to define custom fields."),_elements:{_type:i.Type.String}}},_default:[]},fieldDefinitions:{_type:i.Type.Array,_elements:{id:{_type:i.Type.String,_description:"How this field will be referred to in the `fields` element of the `sectionDefinitions` configuration."},type:{_type:i.Type.String,_description:"How this field's data will be stored—a person attribute or an obs."},uuid:{_type:i.Type.UUID,_description:"Person attribute type UUID that this field's data should be saved to."},label:{_type:i.Type.String,_default:null,_description:"The label of the input. By default, uses the metadata `display` attribute."},placeholder:{_type:i.Type.String,_default:"",_description:"Placeholder that will appear in the input."},validation:{required:{_type:i.Type.Boolean,_default:!1},matches:{_type:i.Type.String,_default:null,_description:"Optional RegEx for testing the validity of the input."}},answerConceptSetUuid:{_type:i.Type.ConceptUuid,_default:null,_description:"For coded questions only. A concept which has the possible responses either as answers or as set members."},customConceptAnswers:{_type:i.Type.Array,_elements:{uuid:{_type:i.Type.UUID,_description:"Answer concept UUID"},label:{_type:i.Type.String,_default:null,_description:"The custom label for the answer concept."}},_default:[],_description:"For coded questions only. Provide ability to add custom concept answers."}},_default:[],_description:"Definitions for custom fields that can be used in sectionDefinitions. Can also be used to override built-in fields."},fieldConfigurations:{name:{displayMiddleName:{_type:i.Type.Boolean,_default:!0},unidentifiedPatient:{_type:i.Type.Boolean,_default:!0,_description:"Whether to allow patients to be registered without names."},defaultUnknownGivenName:{_type:i.Type.String,_default:"UNKNOWN",_description:"The given/first name to record for unidentified patients."},defaultUnknownFamilyName:{_type:i.Type.String,_default:"UNKNOWN",_description:"The family/last name to record for unidentified patients."},displayCapturePhoto:{_type:i.Type.Boolean,_default:!0,_description:"Whether to display capture patient photo slot on name field"}},gender:{_type:i.Type.Array,_elements:{value:{_type:i.Type.String,_description:"The value for sex option"},label:{_type:i.Type.String,_default:null,_description:"The label displayed for sex option."},id:{_type:i.Type.String,_default:null,_description:"The id for sex option."}},_default:[{id:"male",value:"Male",label:"Male"},{id:"female",value:"Female",label:"Female"},{id:"other",value:"Other",label:"Other"},{id:"unknown",value:"Unknown",label:"Unknown"}],_description:"Provide ability to configure sex options."},address:{useAddressHierarchy:{enabled:{_type:i.Type.Boolean,_description:"Whether to use the Address hierarchy in the registration form or not",_default:!0},useQuickSearch:{_type:i.Type.Boolean,_description:"Whether to use the quick searching through the address saved in the database pre-fill the form.",_default:!0},searchAddressByLevel:{_type:i.Type.Boolean,_description:"Whether to fill the addresses by levels, i.e. County => subCounty, the current field is dependent on it's previous field.",_default:!0},useAddressHierarchyLabel:{_type:i.Type.Object,_description:"Whether to use custom labels for address hierarchy",_default:{}}}},dateOfBirth:{useEstimatedDateOfBirth:{enabled:{_type:i.Type.Boolean,_description:"Whether to use custom day and month for estimated date of birth",_default:!1},dayOfMonth:{_type:i.Type.Number,_description:"The custom day of the month use on the estimated date of birth",_default:0},month:{_type:i.Type.Number,_description:"The custom month to use on the estimated date of birth i.e 0 = Jan 11 = Dec",_default:0}}}},links:{submitButton:{_type:i.Type.String,_default:"${openmrsSpaBase}/patient/${patientUuid}/chart",_validators:[i.validators.isUrlWithTemplateParameters(["patientUuid"])]}},concepts:{patientPhotoUuid:{_type:i.Type.ConceptUuid,_default:"736e8771-e501-4615-bfa7-570c03f4bef5"}},defaultPatientIdentifierTypes:{_type:i.Type.Array,_elements:{_type:i.Type.PatientIdentifierTypeUuid},_default:[]},registrationObs:{encounterTypeUuid:{_type:i.Type.UUID,_default:null,_description:"Obs created during registration will be associated with an encounter of this type. This must be set in order to use fields of type `obs`."},encounterProviderRoleUuid:{_type:i.Type.UUID,_default:"a0b03050-c99b-11e0-9572-0800200c9a66",_description:"The provider role to use for the registration encounter. Default is 'Unkown'."},registrationFormUuid:{_type:i.Type.UUID,_default:null,_description:"The form UUID to associate with the registration encounter. By default no form will be associated."}},_validators:[(0,i.validator)((function(e){return!e.fieldDefinitions.some((function(e){return"obs"==e.type}))||null!=e.registrationObs.encounterTypeUuid}),"If fieldDefinitions contains any fields of type 'obs', `registrationObs.encounterTypeUuid` must be specified."),(0,i.validator)((function(e){return e.sections.every((function(t){return a(o).concat(a(e.sectionDefinitions)).map((function(e){return e.id})).includes(t)}))}),(function(e){var t=a(o).concat(a(e.sectionDefinitions)).map((function(e){return e.id})),n=e.sections.find((function(e){return!t.includes(e)}));return"'".concat(n,"' is not a valid section ID. Valid section IDs include the built-in sections ").concat(l(o))+(e.sectionDefinitions.length?"; and the defined sections ".concat(l(e.sectionDefinitions),"."):".")})),(0,i.validator)((function(e){return e.sectionDefinitions.every((function(t){return t.fields.every((function(t){return a(s).concat(a(e.fieldDefinitions.map((function(e){return e.id})))).includes(t)}))}))}),(function(e){var t=a(s).concat(a(e.fieldDefinitions.map((function(e){return e.id})))),n=e.sectionDefinitions.find((function(e){return e.fields.some((function(e){return!t.includes(e)}))})),i=n.fields.find((function(e){return!t.includes(e)}));return"The section definition '".concat(n.id,"' contains an invalid field '").concat(i,"'. 'fields' can only contain the built-in fields '").concat(s.join("', '"),"'")+(e.fieldDefinitions.length?"; or the defined fields ".concat(l(e.fieldDefinitions),"."):".")}))]};function l(e){return"'".concat(e.map((function(e){return e.id})).join("', '"),"'")}},8179:(e,t,n)=>{"use strict";n.d(t,{Kt:()=>l,QT:()=>c,UO:()=>s,e1:()=>u});var i,r,a,o=n(906),s="custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))",u="@openmrs/esm-patient-registration-app",l="patient-registration",c=(i={},a="network-first",(r=o.omrsOfflineCachingStrategyHttpHeaderName)in i?Object.defineProperty(i,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[r]=a,i)},1686:(e,t,n)=>{"use strict";n.r(t),n.d(t,{backendDependencies:()=>v,importTranslation:()=>b,setupOpenMRS:()=>g,version:()=>m});var i=n(906),r=n(3076),a=n(225),o=n(8179),s=n(6279);function u(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var a=e.apply(t,n);function o(e){u(a,i,r,o,s,"next",e)}function s(e){u(a,i,r,o,s,"throw",e)}o(void 0)}))}}var c=function(e,t){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};function d(e){return["/ws/fhir2/R4/Patient/".concat(e),"/ws/rest/v1/relationship?v=".concat(o.UO,"&person=").concat(e),"/ws/rest/v1/person/".concat(e,"/attribute"),"/ws/rest/v1/patient/".concat(e,"/identifier?v=custom:(uuid,identifier,identifierType:(uuid,required,name),preferred)")].map((function(e){return window.origin+(0,i.makeUrl)(e)}))}function f(){return p.apply(this,arguments)}function p(){return(p=l((function(){return c(this,(function(e){switch(e.label){case 0:return[4,Promise.all([(0,s.X1)(),(0,s.Te)(),(0,s.mt)(),(0,s.St)()])];case 1:return e.sent(),[2]}}))}))).apply(this,arguments)}function h(e,t){return y.apply(this,arguments)}function y(){return(y=l((function(e,t){return c(this,(function(n){switch(n.label){case 0:return[4,r.y.savePatientFormOnline(e._patientRegistrationData.isNewPatient,e._patientRegistrationData.formValues,e._patientRegistrationData.patientUuidMap,e._patientRegistrationData.initialAddressFieldValues,e._patientRegistrationData.capturePhotoProps,e._patientRegistrationData.currentLocation,e._patientRegistrationData.initialIdentifierValues,e._patientRegistrationData.currentUser,e._patientRegistrationData.config,e._patientRegistrationData.savePatientTransactionManager,t.abort)];case 1:return n.sent(),[2]}}))}))).apply(this,arguments)}var m="4.0.2-pre.818",b=n(3979),v={"webservices.rest":"^2.24.0"};function g(){var e={featureName:"Patient Registration",moduleName:o.e1};return(0,i.defineConfigSchema)(o.e1,a.bT),(0,i.registerBreadcrumbs)([{path:"".concat(window.spaBase,"/").concat(o.Kt),title:"Patient Registration",parent:"".concat(window.spaBase,"/home")},{path:"".concat(window.spaBase,"/patient/:patientUuid/edit"),title:"Edit patient details",parent:"".concat(window.spaBase,"/patient/:patientUuid/chart")}]),(0,i.setupOfflineSync)(o.Kt,[],h,{onBeginEditSyncItem:function(e){(0,i.navigate)({to:"${openmrsSpaBase}/patient/".concat(e.content.fhirPatient.id,"/edit")})}}),(0,i.subscribePrecacheStaticDependencies)(f),(0,i.setupDynamicOfflineDataHandler)({id:"esm-patient-registration-app:patient",type:"patient",displayName:"Patient registration",isSynced:function(e){return l((function(){var t,n;return c(this,(function(i){switch(i.label){case 0:return t=d(e),[4,caches.open("omrs-spa-cache-v1")];case 1:return[4,i.sent().keys()];case 2:return n=i.sent().map((function(e){return e.url})),[2,t.every((function(e){return n.includes(e)}))]}}))}))()},sync:function(e){return l((function(){var t;return c(this,(function(n){switch(n.label){case 0:return t=d(e),[4,Promise.allSettled(t.map((r=l((function(e){return c(this,(function(t){switch(t.label){case 0:return[4,(0,i.messageOmrsServiceWorker)({type:"registerDynamicRoute",url:e})];case 1:return t.sent(),[4,fetch(e)];case 2:return t.sent(),[2]}}))})),function(e){return r.apply(this,arguments)})))];case 1:return n.sent(),[2]}var r}))}))()}}),{pages:[{load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(430),n.e(375),n.e(154),n.e(924),n.e(658)]).then(n.bind(n,7658))}),e),route:"patient-registration",online:{savePatientForm:r.y.savePatientFormOnline,isOffline:!1},offline:{savePatientForm:r.y.savePatientFormOffline,isOffline:!0}},{load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(430),n.e(375),n.e(154),n.e(924),n.e(658)]).then(n.bind(n,7658))}),{featureName:"edit-patient-details-form",moduleName:o.e1}),route:/patient\/([a-zA-Z0-9\-]+)\/edit/,online:{savePatientForm:r.y.savePatientFormOnline},offline:{savePatientForm:r.y.savePatientFormOffline}}],extensions:[{id:"add-patient-action",slot:"top-nav-actions-slot",load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(430),n.e(375),n.e(206)]).then(n.bind(n,8206))}),e),online:!0,offline:!0},{id:"cancel-patient-edit-modal",load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(430),n.e(924),n.e(735)]).then(n.bind(n,5735))}),e),online:!0,offline:!0},{id:"patient-photo-widget",slot:"patient-photo-slot",load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(854),n.e(975)]).then(n.bind(n,9975))}),e),online:!0,offline:!0},{id:"edit-patient-details-button",slot:"patient-actions-slot",load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(924),n.e(635)]).then(n.bind(n,2635))}),e),online:!0,offline:!0},{id:"edit-patient-details-button",slot:"patient-search-actions-slot",load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(924),n.e(635)]).then(n.bind(n,2635))}),e),online:!0,offline:!0},{id:"delete-identifier-confirmation-modal",load:(0,i.getAsyncLifecycle)((function(){return Promise.all([n.e(430),n.e(924),n.e(242)]).then(n.bind(n,5242))}),e),online:!0,offline:!0}]}}},6279:(e,t,n)=>{"use strict";n.d(t,{Cg:()=>g,St:()=>D,Te:()=>T,X1:()=>w,mt:()=>O});var i=n(268),r=n.n(i),a=n(3662),o=n(2777),s=n(8407),u=n(906),l=n(8179);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function d(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function f(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var a=e.apply(t,n);function o(e){d(a,i,r,o,s,"next",e)}function s(e){d(a,i,r,o,s,"throw",e)}o(void 0)}))}}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){p(e,t,n[t])}))}return e}function y(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n.push.apply(n,i)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var b=function(e,t){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},v=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},g=r().createContext(null);function w(e){return _.apply(this,arguments)}function _(){return(_=f((function(e){return b(this,(function(t){switch(t.label){case 0:return[4,C("/ws/rest/v1/session",e)];case 1:return[2,t.sent().data]}}))}))).apply(this,arguments)}function T(e){return P.apply(this,arguments)}function P(){return(P=f((function(e){return b(this,(function(t){switch(t.label){case 0:return[4,C("/ws/rest/v1/systemsetting?q=layout.address.format&v=custom:(value)",e)];case 1:return[2,t.sent().data]}}))}))).apply(this,arguments)}function O(e){return S.apply(this,arguments)}function S(){return(S=f((function(e){return b(this,(function(t){switch(t.label){case 0:return[4,C("/ws/rest/v1/relationshiptype?v=default",e)];case 1:return[2,t.sent().data]}}))}))).apply(this,arguments)}function D(e){return U.apply(this,arguments)}function U(){return(U=f((function(e){var t,n,i,r,o,s,u,l,c;return b(this,(function(d){switch(d.label){case 0:return[4,j(e)];case 1:t=d.sent(),n=t.filter(Boolean),i=!0,r=!1,o=void 0,d.label=2;case 2:d.trys.push([2,7,8,9]),s=function(){var t,n,i,r;return b(this,(function(o){switch(o.label){case 0:return t=l.value,[4,Promise.all([k(t.uuid,e),F(e)])];case 1:return n=m.apply(void 0,[o.sent(),2]),i=n[0],r=n[1],t.identifierSources=i.data.results.map((function(e){var t=(0,a.Z)(r.data.results,{source:{uuid:e.uuid}});return e.autoGenerationOption=t,e})),[2]}}))},u=n[Symbol.iterator](),d.label=3;case 3:return(i=(l=u.next()).done)?[3,6]:[5,v(s())];case 4:d.sent(),d.label=5;case 5:return i=!0,[3,3];case 6:return[3,9];case 7:return c=d.sent(),r=!0,o=c,[3,9];case 8:try{i||null==u.return||u.return()}finally{if(r)throw o}return[7];case 9:return[2,n]}}))}))).apply(this,arguments)}function j(e){return A.apply(this,arguments)}function A(){return(A=f((function(e){var t,n,i,r,a,s,u,l,c;return b(this,(function(d){switch(d.label){case 0:return[4,C("/ws/rest/v1/patientidentifiertype?v=full",e)];case 1:return t=d.sent(),[4,C("/ws/rest/v1/metadatamapping/termmapping?v=full&code=emr.primaryIdentifierType",e)];case 2:return n=d.sent(),t.ok?(u=null==t||null===(i=t.data)||void 0===i?void 0:i.results,l=null==n||null===(r=n.data)||void 0===r||null===(a=r.results)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.metadataUuid,c=(null==n?void 0:n.ok)?[B(null==u?void 0:u.find((function(e){return e.uuid===l})),!0)]:[],u.forEach((function(e){e.uuid!==l&&c.push(B(e,!1))})),[2,c.map((function(e){return y(h({},e),{fieldName:(0,o.Z)(e.name)})}))]):[2,[]]}}))}))).apply(this,arguments)}function k(e,t){return N.apply(this,arguments)}function N(){return(N=f((function(e,t){return b(this,(function(n){switch(n.label){case 0:return[4,C("/ws/rest/v1/idgen/identifiersource?v=default&identifierType=".concat(e),t)];case 1:return[2,n.sent()]}}))}))).apply(this,arguments)}function F(e){return I.apply(this,arguments)}function I(){return(I=f((function(e){return b(this,(function(t){switch(t.label){case 0:return[4,C("/ws/rest/v1/idgen/autogenerationoption?v=full",e)];case 1:return[2,t.sent()]}}))}))).apply(this,arguments)}function C(e,t){return E.apply(this,arguments)}function E(){return(E=f((function(e,t){return b(this,(function(n){switch(n.label){case 0:return[4,(0,u.messageOmrsServiceWorker)({type:"registerDynamicRoute",pattern:(0,s.Z)(e)})];case 1:return n.sent(),[4,(0,u.openmrsFetch)(e,{headers:l.QT,signal:null==t?void 0:t.signal})];case 2:return[2,n.sent()]}}))}))).apply(this,arguments)}function B(e,t){return{name:e.display,fieldName:(0,o.Z)(e.display),required:e.required,uuid:e.uuid,format:e.format,isPrimary:t,uniquenessBehavior:e.uniquenessBehavior}}},3076:(e,t,n)=>{"use strict";n.d(t,{I:()=>m,y:()=>y});var i=n(906),r=n(8179),a=n(7117);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function s(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var a=e.apply(t,n);function o(e){s(a,i,r,o,u,"next",e)}function u(e){s(a,i,r,o,u,"throw",e)}o(void 0)}))}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){c(e,t,n[t])}))}return e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var p,h=function(e,t){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},y=function(){function e(){l(this,e)}return e.saveRelationships=function(e,t,n){return u((function(){return h(this,(function(i){return[2,Promise.all(e.filter((function(e){return e.relationshipType})).filter((function(e){return!!e.action})).map((function(e){var i=e.relatedPersonUuid,r=e.relationshipType,o=e.uuid,s=e.action,u=f(r.split("/"),2),l=u[0],c=u[1],d=t.data.uuid,p="aIsToB"===c,h={personA:p?i:d,personB:p?d:i,relationshipType:l};switch(s){case"ADD":return(0,a.bL)(n,h);case"UPDATE":return(0,a.r6)(n,o,h);case"DELETE":return(0,a.kE)(n,o)}})))]}))}))()},e.saveObservations=function(e,t,n,i,r,o){return u((function(){var s;return h(this,(function(u){if(e&&Object.keys(e).length>0){if(r.registrationObs.encounterTypeUuid)return s={encounterDatetime:new Date,patient:t.data.uuid,encounterType:r.registrationObs.encounterTypeUuid,location:n,encounterProviders:[{provider:i.currentProvider.uuid,encounterRole:r.registrationObs.encounterProviderRoleUuid}],form:r.registrationObs.registrationFormUuid,obs:Object.keys(e).map((function(t){return{concept:t,value:e[t]}}))},[2,(0,a.M1)(o,s)];console.error("The registration form has been configured to have obs fields, but no registration encounter type has been configured. Obs field values will not be saved.")}return[2]}))}))()},e.savePatientIdentifiers=function(e,t,n,i,r,o){return u((function(){var s;return h(this,(function(l){var c;return s=Object.values(n).map((c=u((function(n){var i,s,u,l,c,d,f,p,y,m;return h(this,(function(h){switch(h.label){case 0:return i=n.identifierTypeUuid,s=n.identifierValue,u=n.identifierUuid,l=n.selectedSource,c=n.preferred,d=n.autoGeneration,f=n.initialValue,s||d&&l?d?[3,1]:(y=s,[3,4]):[3,9];case 1:return[4,(0,a.fX)(n.selectedSource.uuid,o)];case 2:return[4,h.sent().data.identifier];case 3:y=h.sent(),h.label=4;case 4:return m={uuid:u,identifier:p=y,identifierType:i,location:r,preferred:c},e?[3,8]:f?[3,6]:[4,(0,a.eb)(t,m,o)];case 5:return h.sent(),[3,8];case 6:return f===p?[3,8]:[4,(0,a.nI)(t,u,m.identifier,o)];case 7:h.sent(),h.label=8;case 8:return[2,m];case 9:return[2]}}))})),function(e){return c.apply(this,arguments)})),t&&Object.keys(i).filter((function(e){return!n[e]})).forEach(function(){var e=u((function(e){return h(this,(function(n){switch(n.label){case 0:return[4,(0,a.ZB)(t,i[e].identifierUuid,o)];case 1:return n.sent(),[2]}}))}));return function(t){return e.apply(this,arguments)}}()),[2,Promise.all(s)]}))}))()},e.getDeletedNames=function(e,t){return(null==t?void 0:t.additionalNameUuid)?[{nameUuid:t.additionalNameUuid,personUuid:e}]:[]},e.getPatientToCreate=function(t,n,i,r){var a,o,s;return o=t.birthdate,a=(null!=(s=Date)&&"undefined"!=typeof Symbol&&s[Symbol.hasInstance]?s[Symbol.hasInstance](o):o instanceof s)?[t.birthdate.getFullYear(),t.birthdate.getMonth()+1,t.birthdate.getDate()].join("-"):t.birthdate,{uuid:t.patientUuid,person:d({uuid:t.patientUuid,names:e.getNames(t,n),gender:t.gender.charAt(0),birthdate:a,birthdateEstimated:t.birthdateEstimated,attributes:e.getPatientAttributes(t),addresses:[t.address]},e.getPatientDeathInfo(t)),identifiers:r}},e.getNames=function(e,t){var n=[{uuid:t.preferredNameUuid,preferred:!0,givenName:e.givenName,middleName:e.middleName,familyName:e.familyName}];return e.addNameInLocalLanguage&&n.push({uuid:t.additionalNameUuid,preferred:!1,givenName:e.additionalGivenName,middleName:e.additionalMiddleName,familyName:e.additionalFamilyName}),n},e.getPatientAttributes=function(e){var t=[];if(e.attributes){var n=!0,i=!1,r=void 0;try{for(var a,o=Object.entries(e.attributes)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=f(a.value,2),u=s[0],l=s[1];t.push({attributeType:u,value:l})}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return e.unidentifiedPatient&&t.push({attributeType:"8b56eac7-5c76-4b9c-8c6f-1deab8d3fc47",value:"true"}),t},e.getPatientDeathInfo=function(e){var t=e.isDead,n=e.deathDate,i=e.deathCause;return{dead:t,deathDate:t?n:void 0,causeOfDeath:t?i:void 0}},e.mapPatientToFhirPatient=function(e){var t,n,i,r,a,o;return{id:e.uuid,gender:{M:"male",F:"female",O:"other",U:"unknown"}[null===(t=e.person)||void 0===t?void 0:t.gender],birthDate:null===(n=e.person)||void 0===n?void 0:n.birthdate,deceasedBoolean:e.person.dead,deceasedDateTime:e.person.deathDate,name:null===(i=e.person)||void 0===i||null===(r=i.names)||void 0===r?void 0:r.map((function(e){return{given:[e.givenName,e.middleName].filter(Boolean),family:e.familyName}})),address:null===(a=e.person)||void 0===a?void 0:a.addresses.map((function(e){return{city:e.cityVillage,country:e.country,postalCode:e.postalCode,state:e.stateProvince,use:"home"}})),telecom:null===(o=e.person.attributes)||void 0===o?void 0:o.filter((function(e){return"Telephone Number"===e.attributeType}))}},e}();y.savePatientFormOffline=(p=u((function(e,t,n,a,o,s,u,l,c){var d;return h(this,(function(f){switch(f.label){case 0:return d={fhirPatient:y.mapPatientToFhirPatient(y.getPatientToCreate(t,n,a,[])),_patientRegistrationData:{isNewPatient:e,formValues:t,patientUuidMap:n,initialAddressFieldValues:a,capturePhotoProps:o,currentLocation:s,initialIdentifierValues:u,currentUser:l,config:c,savePatientTransactionManager:new m}},[4,(0,i.queueSynchronizationItem)(r.Kt,d,{id:t.patientUuid,displayName:"Patient registration",patientUuid:d.fhirPatient.id,dependencies:[]})];case 1:return f.sent(),[2,null]}}))})),function(e,t,n,i,r,a,o,s,u){return p.apply(this,arguments)}),y.savePatientFormOnline=function(){var e=u((function(e,t,n,i,r,o,s,l,c,d,f){var p,m,b;return h(this,(function(v){switch(v.label){case 0:return[4,y.savePatientIdentifiers(e,t.patientUuid,t.identifiers,s,o,f)];case 1:return p=v.sent(),m=y.getPatientToCreate(t,n,i,p),y.getDeletedNames(t.patientUuid,n).forEach(function(){var e=u((function(e){return h(this,(function(t){switch(t.label){case 0:return[4,(0,a.uO)(e.nameUuid,e.personUuid,f)];case 1:return t.sent(),[2]}}))}));return function(t){return e.apply(this,arguments)}}()),[4,(0,a.co)(f,m,e&&!d.patientSaved?void 0:t.patientUuid)];case 2:return(b=v.sent()).ok?(d.patientSaved=!0,[4,y.saveRelationships(t.relationships,b,f)]):[3,6];case 3:return v.sent(),[4,y.saveObservations(t.obs,b,o,l,c,f)];case 4:return v.sent(),c.concepts.patientPhotoUuid&&(null==r?void 0:r.imageData)?[4,(0,a.oV)(b.data.uuid,r.imageData,"/ws/rest/v1/obs",r.dateTime||(new Date).toISOString(),c.concepts.patientPhotoUuid,f)]:[3,6];case 5:v.sent(),v.label=6;case 6:return[2,b.data.uuid]}}))}));return function(t,n,i,r,a,o,s,u,l,c,d){return e.apply(this,arguments)}}();var m=function e(){l(this,e),this.patientSaved=!1}},7117:(e,t,n)=>{"use strict";n.d(t,{M1:()=>f,M8:()=>_,Uu:()=>w,ZB:()=>U,bL:()=>y,co:()=>d,eb:()=>P,f$:()=>A,fX:()=>p,kE:()=>b,nI:()=>S,oV:()=>v,r6:()=>m,uO:()=>h});var i=n(9857),r=n(2303),a=n(906),o=n(268);function s(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var a=e.apply(t,n);function o(e){s(a,i,r,o,u,"next",e)}function u(e){s(a,i,r,o,u,"throw",e)}o(void 0)}))}}var l=function(e,t){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};function c(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],i=new Uint8Array(t.length),r=0;r<t.length;r++)i[r]=t.charCodeAt(r);var a=new Blob([i],{type:n});return new File([a],"patient-photo.png")}function d(e,t,n){return(0,a.openmrsFetch)("/ws/rest/v1/patient/".concat(n||""),{headers:{"Content-Type":"application/json"},method:"POST",body:t,signal:e.signal})}function f(e,t){return(0,a.openmrsFetch)("/ws/rest/v1/encounter",{headers:{"Content-Type":"application/json"},method:"POST",body:t,signal:e.signal})}function p(e,t){return(0,a.openmrsFetch)("/ws/rest/v1/idgen/identifiersource/".concat(e,"/identifier"),{headers:{"Content-Type":"application/json"},method:"POST",body:{},signal:t.signal})}function h(e,t,n){return(0,a.openmrsFetch)("/ws/rest/v1/person/".concat(t,"/name/").concat(e),{method:"DELETE",signal:n.signal})}function y(e,t){return(0,a.openmrsFetch)("/ws/rest/v1/relationship",{headers:{"Content-Type":"application/json"},method:"POST",body:t,signal:e.signal})}function m(e,t,n){return(0,a.openmrsFetch)("/ws/rest/v1/relationship/".concat(t),{headers:{"Content-Type":"application/json"},method:"POST",body:{relationshipType:n.relationshipType},signal:e.signal})}function b(e,t){return(0,a.openmrsFetch)("/ws/rest/v1/relationship/".concat(t),{headers:{"Content-Type":"application/json"},method:"DELETE",signal:e.signal})}function v(e,t,n,i,r,a){return g.apply(this,arguments)}function g(){return(g=u((function(e,t,n,i,r,o){var s;return l(this,(function(u){return(s=new FormData).append("patient",e),s.append("file",c(t)),s.append("json",JSON.stringify({person:e,concept:r,groupMembers:[],obsDatetime:i})),[2,(0,a.openmrsFetch)(n,{method:"POST",signal:o.signal,body:s})]}))}))).apply(this,arguments)}function w(e){var t,n,r,o=(0,a.useConfig)().concepts.patientPhotoUuid,s="/ws/rest/v1/obs?patient=".concat(e,"&concept=").concat(o,"&v=full"),u=(0,i.ZP)(e?s:null,a.openmrsFetch),l=u.data,c=u.error,d=null==l||null===(t=l.data)||void 0===t?void 0:t.results[0];return{data:d?{dateTime:null==d?void 0:d.obsDatetime,imageSrc:null==d||null===(n=d.value)||void 0===n||null===(r=n.links)||void 0===r?void 0:r.uri}:null,isError:c,isLoading:!l&&!c}}function _(e,t){return T.apply(this,arguments)}function T(){return(T=u((function(e,t){return l(this,(function(n){return[2,(0,a.openmrsFetch)("/ws/rest/v1/person?q=".concat(e),{signal:t.signal})]}))}))).apply(this,arguments)}function P(e,t,n){return O.apply(this,arguments)}function O(){return(O=u((function(e,t,n){return l(this,(function(i){return[2,(0,a.openmrsFetch)("/ws/rest/v1/patient/".concat(e,"/identifier/"),{method:"POST",headers:{"Content-Type":"application/json"},signal:n.signal,body:t})]}))}))).apply(this,arguments)}function S(e,t,n,i){return D.apply(this,arguments)}function D(){return(D=u((function(e,t,n,i){return l(this,(function(r){return[2,(0,a.openmrsFetch)("/ws/rest/v1/patient/".concat(e,"/identifier/").concat(t),{method:"POST",headers:{"Content-Type":"application/json"},signal:i.signal,body:{identifier:n}})]}))}))).apply(this,arguments)}function U(e,t,n){return j.apply(this,arguments)}function j(){return(j=u((function(e,t,n){return l(this,(function(i){return[2,(0,a.openmrsFetch)("/ws/rest/v1/patient/".concat(e,"/identifier/").concat(t,"?purge"),{method:"DELETE",headers:{"Content-Type":"application/json"},signal:n.signal})]}))}))).apply(this,arguments)}function A(e,t){var n,i=(0,r.Z)(e?"/module/addresshierarchy/ajax/getPossibleFullAddresses.form?separator=".concat(t,"&searchString=").concat(e):null,a.openmrsFetch),s=i.data,u=i.error,l=(0,o.useMemo)((function(){var e;return{addresses:null!==(n=null==s||null===(e=s.data)||void 0===e?void 0:e.map((function(e){return e.address})))&&void 0!==n?n:[],error:u,isLoading:!s&&!u}}),[s,u]);return l}},3979:(e,t,n)=>{var i={"./en.json":[3574,574],"./km.json":[7807,807]};function r(e){if(!n.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],r=t[0];return n.e(t[1]).then((()=>n(r)))}r.keys=()=>Object.keys(i),r.id=3979,e.exports=r}}]);
@@ -98,7 +98,7 @@
98
98
  "main.js"
99
99
  ],
100
100
  "auxiliaryFiles": [],
101
- "hash": "e3fa1c6495c2e2f5006d",
101
+ "hash": "43a23f8f501ec7169aa5",
102
102
  "childrenByOrder": {}
103
103
  },
104
104
  {
@@ -270,9 +270,9 @@
270
270
  "initial": false,
271
271
  "entry": false,
272
272
  "recorded": false,
273
- "size": 3263,
273
+ "size": 3311,
274
274
  "sizes": {
275
- "javascript": 3263
275
+ "javascript": 3311
276
276
  },
277
277
  "names": [],
278
278
  "idHints": [],
@@ -284,7 +284,7 @@
284
284
  "574.js"
285
285
  ],
286
286
  "auxiliaryFiles": [],
287
- "hash": "3727ce4facf8b6975ef3",
287
+ "hash": "19fe5e336b5568340bcc",
288
288
  "childrenByOrder": {}
289
289
  },
290
290
  {
@@ -314,9 +314,9 @@
314
314
  "initial": false,
315
315
  "entry": false,
316
316
  "recorded": false,
317
- "size": 252458,
317
+ "size": 252643,
318
318
  "sizes": {
319
- "javascript": 252416,
319
+ "javascript": 252601,
320
320
  "consume-shared": 42
321
321
  },
322
322
  "names": [],
@@ -329,7 +329,7 @@
329
329
  "658.js"
330
330
  ],
331
331
  "auxiliaryFiles": [],
332
- "hash": "b5cd2eb1fbc699bff501",
332
+ "hash": "59f543540d9629f58482",
333
333
  "childrenByOrder": {}
334
334
  },
335
335
  {
@@ -351,7 +351,7 @@
351
351
  "686.js"
352
352
  ],
353
353
  "auxiliaryFiles": [],
354
- "hash": "d6ed8aeae45a399057b0",
354
+ "hash": "6fb2846ec0d26d735cf4",
355
355
  "childrenByOrder": {}
356
356
  },
357
357
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-patient-registration-app",
3
- "version": "4.0.2-pre.816",
3
+ "version": "4.0.2-pre.818",
4
4
  "description": "Patient registration microfrontend for the OpenMRS SPA",
5
5
  "browser": "dist/openmrs-esm-patient-registration-app.js",
6
6
  "main": "src/index.ts",
@@ -52,5 +52,5 @@
52
52
  "devDependencies": {
53
53
  "webpack": "^5.74.0"
54
54
  },
55
- "gitHead": "702557d15775ce3bd43712e6fe565c258137a008"
55
+ "gitHead": "afa9dc5f2b574eb7f63b8e3b7b292e69317dd630"
56
56
  }
@@ -17,6 +17,13 @@ export const GenderField: React.FC = () => {
17
17
  const setGender = (gender: string) => {
18
18
  setFieldValue('gender', gender);
19
19
  };
20
+ /**
21
+ * DO NOT REMOVE THIS COMMENT HERE, ADDS TRANSLATION FOR SEX OPTIONS
22
+ * t('male', 'Male')
23
+ * t('female', 'Female')
24
+ * t('other', 'Other')
25
+ * t('unknown', 'Unknown')
26
+ */
20
27
 
21
28
  return (
22
29
  <div className={styles.halfWidthInDesktopView}>
@@ -32,6 +32,7 @@
32
32
  "estimatedAgeInYearsLabelText": "Estimated age in years",
33
33
  "familyNameLabelText": "Family Name",
34
34
  "familyNameRequired": "Family name is required",
35
+ "female": "Female",
35
36
  "fieldErrorTitleMessage": "The following fields have errors:",
36
37
  "fullNameLabelText": "Full Name",
37
38
  "genderLabelText": "Sex",
@@ -47,6 +48,7 @@
47
48
  "isDeadInputLabel": "Is Dead",
48
49
  "jumpTo": "Jump to",
49
50
  "loadingResults": "Loading results",
51
+ "male": "Male",
50
52
  "middleNameLabelText": "Middle Name",
51
53
  "months": "Months",
52
54
  "negativeMonths": "Negative months",
@@ -55,6 +57,7 @@
55
57
  "noResultsFound": "No results found",
56
58
  "numberInNameDubious": "Number is name is dubious",
57
59
  "optional": "optional",
60
+ "other": "Other",
58
61
  "patient": "Patient",
59
62
  "patientNameKnown": "Patient's Name is Known?",
60
63
  "phoneEmailLabelText": "Phone, Email, etc.",