diff --git a/api/src/main/resources/messages.properties b/api/src/main/resources/messages.properties index 71f52028..af50dc2d 100644 --- a/api/src/main/resources/messages.properties +++ b/api/src/main/resources/messages.properties @@ -132,10 +132,8 @@ registrationapp.person.relationship.selectRelationshipType=Select Relationship T #Continuity of Care registrationapp.continuityOfCare.label=Continuity of Care registrationapp.continuityOfCare.info=This Patient already has demographic information and fingerprints recorded in SEDISH -registrationapp.continuityOfCare.info.missing=This Patient does not have a locally stored CCD! registrationapp.continuityOfCare.document.date=Document Date registrationapp.continuityOfCare.document.import=Import registrationapp.continuityOfCare.document.view=View -registrationapp.continuityOfCare.document.refresh=Re-Import registrationapp.continuityOfCare.document.import.dialog.label=Continuity of Care Document Import registrationapp.continuityOfCare.document.import.dialog.message=Do you want to download this information? diff --git a/api/src/main/resources/messages_fr.properties b/api/src/main/resources/messages_fr.properties index f5b21515..a95dac49 100644 --- a/api/src/main/resources/messages_fr.properties +++ b/api/src/main/resources/messages_fr.properties @@ -132,10 +132,8 @@ registrationapp.dateCreated=Date créée #Continuity of Care registrationapp.continuityOfCare.label=Continuité des Soins registrationapp.continuityOfCare.info=Ce Patient a deja des informations demographiques et des empreinter enregistrées sur SEDISH -registrationapp.continuityOfCare.info.missing=Ce patient n'a pas de CCD stocké localement! registrationapp.continuityOfCare.document.date=Document Date registrationapp.continuityOfCare.document.import=Importer registrationapp.continuityOfCare.document.view=Vue -registrationapp.continuityOfCare.document.refresh=Réimporter registrationapp.continuityOfCare.document.import.dialog.label=Continuité des Soins Document Importer registrationapp.continuityOfCare.document.import.dialog.message=Voulez vous telechargez ces information? diff --git a/omod/pom.xml b/omod/pom.xml index 4f02638f..2f1461d6 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -232,23 +232,23 @@ - - - - - - - - - - - - - - - - - + + de.saumya.mojo + gem-maven-plugin + true + + + + exec + + generate-resources + + + + 1.7.10 + ${gem.home}/bin/compass compile ${basedir}/src/main/compass + + @@ -259,23 +259,23 @@ watch-sass - - - - - - - - - - - - - - - - - + + de.saumya.mojo + gem-maven-plugin + true + + + + exec + + generate-resources + + + + 1.7.10 + ${gem.home}/bin/compass watch ${basedir}/src/main/compass + + diff --git a/omod/src/main/compass/sass/registerPatient.scss b/omod/src/main/compass/sass/registerPatient.scss index 43eb18ef..99cb4abb 100644 --- a/omod/src/main/compass/sass/registerPatient.scss +++ b/omod/src/main/compass/sass/registerPatient.scss @@ -2,14 +2,3 @@ #simplemodal-container, .dialog { width: 1000px !important; } - -.loader { - fill: #363463; - -webkit-animation: spin 2s linear infinite; /* Safari */ - animation: spin 2s linear infinite; -} - -@keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } -} diff --git a/omod/src/main/java/org/openmrs/module/registrationapp/fragment/controller/MatchingPatientsFragmentController.java b/omod/src/main/java/org/openmrs/module/registrationapp/fragment/controller/MatchingPatientsFragmentController.java index d4e0e6f9..9cb38126 100644 --- a/omod/src/main/java/org/openmrs/module/registrationapp/fragment/controller/MatchingPatientsFragmentController.java +++ b/omod/src/main/java/org/openmrs/module/registrationapp/fragment/controller/MatchingPatientsFragmentController.java @@ -13,8 +13,6 @@ */ package org.openmrs.module.registrationapp.fragment.controller; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.codehaus.jackson.JsonNode; import org.openmrs.Patient; import org.openmrs.PatientIdentifier; @@ -57,13 +55,12 @@ public class MatchingPatientsFragmentController { public static final int MAX_RESULTS = 10; public static final double CUTOFF = 2.0; - private final Log log = LogFactory.getLog(this.getClass()); public static final String[] PATIENT_PROPERTIES = new String[]{"uuid", "givenName", "familyName", "gender", "birthdate", "personAddress"}; public static final String[] MPI_PATIENT_PROPERTIES = new String[]{"uuid", "givenName", "familyName", - "gender", "birthdate", "personAddress", "mpiPatient", "sourceLocation"}; + "gender", "birthdate", "personAddress", "mpiPatient"}; public List getSimilarPatients(@RequestParam("appId") AppDescriptor app, @SpringBean("registrationCoreService") RegistrationCoreService service, @@ -80,16 +77,8 @@ public List getSimilarPatients(@RequestParam("appId") AppDescripto NavigableFormStructure formStructure = RegisterPatientFormBuilder.buildFormStructure(app); RegisterPatientFormBuilder.resolvePatientIdentifierFields(formStructure, patient, request.getParameterMap()); - List matches = new ArrayList(); - List fastSimilarPatients = service.findFastSimilarPatients(patient, otherDataPoints, CUTOFF, determineMaxResults(app)); - for(PatientAndMatchQuality pm:fastSimilarPatients){ - log.error("VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVvv"); - log.error(pm.getSourceLocation()); - log.error("VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVvv"); - } - if(fastSimilarPatients!=null && fastSimilarPatients.size() > 0){ - matches.addAll(fastSimilarPatients) ; - } + + List matches = service.findFastSimilarPatients(patient, otherDataPoints, CUTOFF, determineMaxResults(app)); return getSimpleObjects(app, ui, matches); } @@ -201,9 +190,6 @@ private void addIdentifiersToPatientSimple(Patient patientEntry, SimpleObject pa if (Arrays.asList(defaultProperties).contains("mpiPatient")) { propertiesToIncludeList.add("mpiPatient"); } - if (Arrays.asList(defaultProperties).contains("sourceLocation")) { - propertiesToIncludeList.add("sourceLocation"); - } Iterator i = app.getConfig().get("matchingPatientsPropertiesToDisplay").getElements(); while (i.hasNext()) { propertiesToIncludeList.add(i.next().getTextValue()); @@ -229,7 +215,6 @@ private void addRequiredPropertiesToInclude(List propertiesToInclude) { addIfMissing("gender", propertiesToInclude); addIfMissing("personAddress", propertiesToInclude); addIfMissing("birthdate", propertiesToInclude); - addIfMissing("sourceLocation", propertiesToInclude); } private void addIfMissing(String property, List propertiesToInclude) { diff --git a/omod/src/main/java/org/openmrs/module/registrationapp/fragment/controller/summary/ContinuityOfCareFragmentController.java b/omod/src/main/java/org/openmrs/module/registrationapp/fragment/controller/summary/ContinuityOfCareFragmentController.java index 99dff1ff..edc05762 100644 --- a/omod/src/main/java/org/openmrs/module/registrationapp/fragment/controller/summary/ContinuityOfCareFragmentController.java +++ b/omod/src/main/java/org/openmrs/module/registrationapp/fragment/controller/summary/ContinuityOfCareFragmentController.java @@ -1,6 +1,5 @@ package org.openmrs.module.registrationapp.fragment.controller.summary; -import org.dcm4chee.xds2.common.exception.XDSException; import org.openmrs.Patient; import org.openmrs.api.context.Context; import org.openmrs.module.xdssender.api.domain.Ccd; @@ -33,15 +32,13 @@ public void controller(FragmentModel model, @FragmentParam("patientId") Integer public String viewCCD(@RequestParam("patientId") Integer patientId) { Patient patient = Context.getPatientService().getPatient(patientId); - return getCcdService().getHtmlParsedLocallyStoredCcd(patient); + return getCcdService().getLocallyStoredCcd(patient).getDocument(); } - public String importCCD(@RequestParam("patientId") Integer patientId, HttpServletResponse response) throws IOException, XDSException { - Patient patient = Context.getPatientService().getPatient(patientId); - Ccd ccd = getCcdService().downloadAndSaveCcd(patient); - return getCcdService().getHtmlParsedLocallyStoredCcd(ccd); + public void importCCD(@RequestParam("patientId") Integer patientId, HttpServletResponse response) throws IOException { + getCcdService().downloadCcdAsPDF(response.getOutputStream(), Context.getPatientService().getPatient(patientId)); } - + private CcdService getCcdService() { return Context.getRegisteredComponent("xdsSender.CcdService", CcdService.class); } diff --git a/omod/src/main/webapp/fragments/summary/continuityOfCare.gsp b/omod/src/main/webapp/fragments/summary/continuityOfCare.gsp index 03755300..e741833f 100644 --- a/omod/src/main/webapp/fragments/summary/continuityOfCare.gsp +++ b/omod/src/main/webapp/fragments/summary/continuityOfCare.gsp @@ -1,70 +1,44 @@ <% ui.includeJavascript("registrationapp", "summary/continuityOfCare.js") - ui.includeCss("registrationapp","continuityOfCare.css") %> <% if (isCCDAvailable) { %> - - - - ${ ui.message("registrationapp.continuityOfCare.label") } - - - - - ${ ui.message("registrationapp.continuityOfCare.document.date") } - ${ ui.message(CCDDate) } - - - - ${ ui.message("registrationapp.continuityOfCare.info") } - + + + + ${ ui.message("registrationapp.continuityOfCare.label") } - - - ${ ui.message("registrationapp.continuityOfCare.document.view") } - - - ${ ui.message("registrationapp.continuityOfCare.document.refresh") } - - - - - -<% } else{%> - - - - ${ ui.message("registrationapp.continuityOfCare.label") } - - - - - - ${ ui.message("registrationapp.continuityOfCare.info.missing") } + + + + ${ ui.message("registrationapp.continuityOfCare.document.date") } + ${ ui.message(CCDDate) } + + + + ${ ui.message("registrationapp.continuityOfCare.info") } + + + + + ${ ui.message("registrationapp.continuityOfCare.document.view") } + - - - ${ ui.message("registrationapp.continuityOfCare.document.import") } - - - - - - ${ui.message("registrationapp.continuityOfCare.document.import.dialog.label")} - - - - ${ui.message("registrationapp.continuityOfCare.document.import.dialog.message")} - - - - ${ui.message("emr.yes")} - ${ui.message("emr.no")} + + + ${ui.message("registrationapp.continuityOfCare.document.import.dialog.label")} + + + + ${ui.message("registrationapp.continuityOfCare.document.import.dialog.message")} + + + + ${ui.message("emr.yes")} + ${ui.message("emr.no")} + - - -<%}%> +<% } %> diff --git a/omod/src/main/webapp/pages/registerPatient.gsp b/omod/src/main/webapp/pages/registerPatient.gsp index a5960037..80bea259 100644 --- a/omod/src/main/webapp/pages/registerPatient.gsp +++ b/omod/src/main/webapp/pages/registerPatient.gsp @@ -60,10 +60,6 @@ ${ ui.includeFragment("uicommons", "validationMessages")} font-size: 15px; display: inline-block; } -.matchingPatientContainer .container .location { - font-size: 15px; - display: inline-block; -} .matchingPatientContainer .container .identifiers { font-size: 15px; @@ -149,7 +145,6 @@ ${ ui.includeFragment("uicommons", "validationMessages")} - ${ui.message("registrationapp.open")} diff --git a/omod/src/main/webapp/resources/scripts/registerPatient.js b/omod/src/main/webapp/resources/scripts/registerPatient.js index 315bb1fb..0d946541 100644 --- a/omod/src/main/webapp/resources/scripts/registerPatient.js +++ b/omod/src/main/webapp/resources/scripts/registerPatient.js @@ -49,13 +49,8 @@ jq(function() { jq('#similarPatientsCount').text(data.length); var similarPatientsSelect = jq('#similarPatientsSelect'); similarPatientsSelect.empty(); - var identifier; for (index in data) { var item = data[index]; - - console.log(item); - - var isMpi = false; if (data[index].mpiPatient != null && data[index].mpiPatient == true) { isMpi = true; @@ -99,17 +94,12 @@ jq(function() { }); } - if (item.sourceLocation) { - cloned.find('.location').append('Source :' + item.sourceLocation) - } - var button; if (isMpi) { idToUse = item.uuid for (var i = 0; i < item.identifiers.length; i += 1) { identifier = item.identifiers[i]; - // if (identifier.name === 'ECID') { - if (identifier.name === 'iSantePlus ID') { + if (identifier.name === 'ECID') { idToUse = identifier.value; break; } @@ -117,7 +107,7 @@ jq(function() { button = $('#matchedPatientTemplates .mpi_button').clone(); button.attr("onclick", "importMpiPatient('" + idToUse + "')"); - } else { + } else {0 button = $('#matchedPatientTemplates .local_button').clone(); var link = patientDashboardLink; link += (link.indexOf('?') == -1 ? '?' : '&') + 'patientId=' + item.uuid; diff --git a/omod/src/main/webapp/resources/scripts/summary/continuityOfCare.js b/omod/src/main/webapp/resources/scripts/summary/continuityOfCare.js index 1be87e02..f92a0897 100644 --- a/omod/src/main/webapp/resources/scripts/summary/continuityOfCare.js +++ b/omod/src/main/webapp/resources/scripts/summary/continuityOfCare.js @@ -1,9 +1,9 @@ function viewCCD(patientId) { - var newWindow = window.open(); - jq.getJSON( + var newWindow = window.open(); + jq.getJSON( '/' + OPENMRS_CONTEXT_PATH + '/registrationapp/summary/continuityOfCare/viewCCD.action', {patientId: patientId}, - function (ccdContent) { + function(ccdContent) { newWindow.document.write('Ccd document' + ccdContent); newWindow.document.close(); } @@ -15,40 +15,9 @@ function importCCD(patientId) { selector: '#ccd-import-dialog', actions: { confirm: function () { - var newWindow = window.open(); - jq.getJSON('/' + OPENMRS_CONTEXT_PATH + '/registrationapp/summary/continuityOfCare/importCCD.action', {patientId: patientId}, - function (ccdContent) { - // reload the page to show the view button - redirectToPatientCcd(newWindow,ccdContent); - reloadPage(); - }); + jq.getJSON('/' + OPENMRS_CONTEXT_PATH + '/registrationapp/summary/continuityOfCare/importCCD.action', {patientId: patientId}); $.modal.close(); } } }).show(); } - -function redirectToPatientCcd(newWindow,ccdContent) { - newWindow.document.write('Ccd document' + ccdContent); - newWindow.document.close(); -} - -function reloadPage(){ - location.reload(); - return false; -} - - -function refreshCcd(patientId) { - var newWindow = window.open(); - var element = document.getElementById('ccdRefresh'); - //add spinning animation to indicate loading - element.classList.add("loader"); - jq.getJSON('/' + OPENMRS_CONTEXT_PATH + '/registrationapp/summary/continuityOfCare/importCCD.action', {patientId: patientId}, - function (ccdContent) { - // remove the animation from the reload icon and reload the web page to show the view button - element.classList.remove("loader"); - redirectToPatientCcd(newWindow,ccdContent); - reloadPage(); - }); -}
${ ui.message(CCDDate) }
${ ui.message("registrationapp.continuityOfCare.info") }
${ ui.message("registrationapp.continuityOfCare.info.missing") }
- ${ui.message("registrationapp.continuityOfCare.document.import.dialog.message")} -
+ ${ui.message("registrationapp.continuityOfCare.document.import.dialog.message")} +