Skip to content

Commit

Permalink
Merge pull request #20 from IsantePlus/revert-19-master
Browse files Browse the repository at this point in the history
Revert "Recent updates for MPI work"
  • Loading branch information
pmanko authored Dec 17, 2020
2 parents 0319364 + 9ae4e4d commit 8b01797
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 185 deletions.
2 changes: 0 additions & 2 deletions api/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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?
2 changes: 0 additions & 2 deletions api/src/main/resources/messages_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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?
68 changes: 34 additions & 34 deletions omod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -232,23 +232,23 @@
</executions>
</plugin>

<!--<plugin>-->
<!--<groupId>de.saumya.mojo</groupId>-->
<!--<artifactId>gem-maven-plugin</artifactId>-->
<!--<extensions>true</extensions>-->
<!--<executions>-->
<!--<execution>-->
<!--<goals>-->
<!--<goal>exec</goal>-->
<!--</goals>-->
<!--<phase>generate-resources</phase>-->
<!--</execution>-->
<!--</executions>-->
<!--<configuration>-->
<!--<jrubyVersion>1.7.10</jrubyVersion>-->
<!--<execArgs>${gem.home}/bin/compass compile ${basedir}/src/main/compass</execArgs>-->
<!--</configuration>-->
<!--</plugin>-->
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
<phase>generate-resources</phase>
</execution>
</executions>
<configuration>
<jrubyVersion>1.7.10</jrubyVersion>
<execArgs>${gem.home}/bin/compass compile ${basedir}/src/main/compass</execArgs>
</configuration>
</plugin>


</plugins>
Expand All @@ -259,23 +259,23 @@
<id>watch-sass</id>
<build>
<plugins>
<!--<plugin>-->
<!--<groupId>de.saumya.mojo</groupId>-->
<!--<artifactId>gem-maven-plugin</artifactId>-->
<!--<extensions>true</extensions>-->
<!--<executions>-->
<!--<execution>-->
<!--<goals>-->
<!--<goal>exec</goal>-->
<!--</goals>-->
<!--<phase>generate-resources</phase>-->
<!--</execution>-->
<!--</executions>-->
<!--<configuration>-->
<!--<jrubyVersion>1.7.10</jrubyVersion>-->
<!--<execArgs>${gem.home}/bin/compass watch ${basedir}/src/main/compass</execArgs>-->
<!--</configuration>-->
<!--</plugin>-->
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
<phase>generate-resources</phase>
</execution>
</executions>
<configuration>
<jrubyVersion>1.7.10</jrubyVersion>
<execArgs>${gem.home}/bin/compass watch ${basedir}/src/main/compass</execArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down
11 changes: 0 additions & 11 deletions omod/src/main/compass/sass/registerPatient.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<SimpleObject> getSimilarPatients(@RequestParam("appId") AppDescriptor app,
@SpringBean("registrationCoreService") RegistrationCoreService service,
Expand All @@ -80,16 +77,8 @@ public List<SimpleObject> getSimilarPatients(@RequestParam("appId") AppDescripto
NavigableFormStructure formStructure = RegisterPatientFormBuilder.buildFormStructure(app);

RegisterPatientFormBuilder.resolvePatientIdentifierFields(formStructure, patient, request.getParameterMap());
List<PatientAndMatchQuality> matches = new ArrayList<PatientAndMatchQuality>();
List<PatientAndMatchQuality> 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<PatientAndMatchQuality> matches = service.findFastSimilarPatients(patient, otherDataPoints, CUTOFF, determineMaxResults(app));
return getSimpleObjects(app, ui, matches);
}

Expand Down Expand Up @@ -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<JsonNode> i = app.getConfig().get("matchingPatientsPropertiesToDisplay").getElements();
while (i.hasNext()) {
propertiesToIncludeList.add(i.next().getTextValue());
Expand All @@ -229,7 +215,6 @@ private void addRequiredPropertiesToInclude(List<String> propertiesToInclude) {
addIfMissing("gender", propertiesToInclude);
addIfMissing("personAddress", propertiesToInclude);
addIfMissing("birthdate", propertiesToInclude);
addIfMissing("sourceLocation", propertiesToInclude);
}

private void addIfMissing(String property, List<String> propertiesToInclude) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
92 changes: 33 additions & 59 deletions omod/src/main/webapp/fragments/summary/continuityOfCare.gsp
Original file line number Diff line number Diff line change
@@ -1,70 +1,44 @@
<%
ui.includeJavascript("registrationapp", "summary/continuityOfCare.js")
ui.includeCss("registrationapp","continuityOfCare.css")
%>
<% if (isCCDAvailable) { %>
<div class="info-section">
<div class="info-header">
<i class="icon-user"></i>
<h3>${ ui.message("registrationapp.continuityOfCare.label") }</h3>
</div>
<div class="info-body summary-section">
<div id="ccd-fragment">
<div>
<h3>${ ui.message("registrationapp.continuityOfCare.document.date") }</h3>
<p class="left">${ ui.message(CCDDate) }</p>
</div>
<div>
<h3></h3>
<p class="left">${ ui.message("registrationapp.continuityOfCare.info") }</p>
</div>
<div class="info-section">
<div class="info-header">
<i class="icon-user"></i>
<h3>${ ui.message("registrationapp.continuityOfCare.label") }</h3>
</div>
<div id="buttons">
<button type="button" class="confirm" onclick="viewCCD(${ config.patientId })">
${ ui.message("registrationapp.continuityOfCare.document.view") }
</button>
<a class="button confirm right" href="#" onclick="refreshCcd(${ config.patientId })">
${ ui.message("registrationapp.continuityOfCare.document.refresh") }
<i id="ccdRefresh" class="icon-refresh" title="Update CCD"> </i>
</a>
</div>
</div>
</div>
<% } else{%>
<div class="info-section">
<div class="info-header">
<i class="icon-user"></i>
<h3>${ ui.message("registrationapp.continuityOfCare.label") }</h3>
</div>
<div class="info-body summary-section">
<div id="ccd-import-fragment">
<div>
<h3></h3>
<p class="left">${ ui.message("registrationapp.continuityOfCare.info.missing") }</p>
<div class="info-body summary-section">
<div id="ccd-fragment">
<div>
<h3>${ ui.message("registrationapp.continuityOfCare.document.date") }</h3>
<p class="left">${ ui.message(CCDDate) }</p>
</div>
<div>
<h3></h3>
<p class="left">${ ui.message("registrationapp.continuityOfCare.info") }</p>
</div>
</div>
<div id="buttons">
<button type="button" class="confirm" onclick="viewCCD(${ config.patientId })">
${ ui.message("registrationapp.continuityOfCare.document.view") }
</button>
</div>
</div>
<div id="import-buttons">
<button type="button" class="confirm" onclick="importCCD(${ config.patientId })">
${ ui.message("registrationapp.continuityOfCare.document.import") }
</button>
</div>
</div>

<div style="display:none" id="ccd-import-dialog" class="dialog">
<div class="dialog-header">
${ui.message("registrationapp.continuityOfCare.document.import.dialog.label")}
</div>
<div class="dialog-content">
<p>
${ui.message("registrationapp.continuityOfCare.document.import.dialog.message")}
</p>
<br/>
<div class="buttons">
<button class="confirm right">${ui.message("emr.yes")}</button>
<button class="cancel">${ui.message("emr.no")}</button>
<div style="display:none" id="ccd-import-dialog" class="dialog">
<div class="dialog-header">
${ui.message("registrationapp.continuityOfCare.document.import.dialog.label")}
</div>
<div class="dialog-content">
<p>
${ui.message("registrationapp.continuityOfCare.document.import.dialog.message")}
</p>
<br/>
<div class="buttons">
<button class="confirm right">${ui.message("emr.yes")}</button>
<button class="cancel">${ui.message("emr.no")}</button>
</div>
</div>
</div>
</div>
</div>

<%}%>
<% } %>
5 changes: 0 additions & 5 deletions omod/src/main/webapp/pages/registerPatient.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -149,7 +145,6 @@ ${ ui.includeFragment("uicommons", "validationMessages")}
<div class="identifiers">
<span class="idName idNameTemplate"></span><span class="idValue idValueTemplate"></span>
</div>
<div class="location"></div>
</div>
<button class="local_button" style="float:right; margin:10px; padding: 2px 8px" onclick="location.href='/openmrs-standalone/coreapps/clinicianfacing/patient.page?patientId=7'">
${ui.message("registrationapp.open")}
Expand Down
14 changes: 2 additions & 12 deletions omod/src/main/webapp/resources/scripts/registerPatient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -99,25 +94,20 @@ 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;
}
}

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;
Expand Down
Loading

0 comments on commit 8b01797

Please sign in to comment.