Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kenyaemr migration changes #4

Open
wants to merge 86 commits into
base: master
Choose a base branch
from

Conversation

ojwanganto
Copy link

No description provided.

import java.util.Arrays;
import java.util.List;

public class HTSGroupedObservations implements DatasetGroupedObservations {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the meaning of HTSGroupedObservations?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkayiwa I am trying to process grouped observations in an Hiv Testing Services' dataset. I am thinking of putting all these in an excel/csv template for ease of editing.

@@ -340,12 +360,13 @@ public static File importTemplate(SpreadsheetImportTemplate template, MultipartF
Exception exception = null;
try {
DatabaseBackend.validateData(rowData);
String encounterId = DatabaseBackend.importData(rowData, rollbackTransaction);
/*String encounterId = DatabaseBackend.importData(rowData, rowEncDate, rollbackTransaction);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intentionally comment this out?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove this. I added Encounter Date in the provided dataset and should apply to an entire row.

} catch (SpreadsheetImportTemplateValidationException e) {
messages.add("Validation failed: " + e.getMessage());
return null;
} catch (SpreadsheetImportDuplicateValueException e) {
} /*catch (SpreadsheetImportDuplicateValueException e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intentionally comment this out?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove this

}
}

/* for (SpreadsheetImportTemplatePrespecifiedValue s : template.getPrespecifiedValues()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I added a new controller to handle DB based datasets, I will restore this class to its original content and have all changes in the new class.

@@ -146,7 +151,7 @@ public String processSubmit(@ModelAttribute("template") SpreadsheetImportTemplat
else if ("CWE".equals(hl7Abbrev))
column.setTableDotColumn("obs.value_coded");
else if ("BIT".equals(hl7Abbrev))
column.setTableDotColumn("obs.value_boolean");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we drop support for older versions?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will restore this

template.clearPrespecifiedValues();
template.clearColumnColumns();
SpreadsheetImportUtil.resolveTemplateDependencies(template);
//template.clearPrespecifiedValues();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intentionally comment this out?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line clears values of obs, person attributes, and identifiers on the edit form. Sometimes one simply wants access to what was previous configurations.

//template = Context.getService(SpreadsheetImportService.class).getTemplateById(tableToTemplateMap.get("demographics"));
//successfulProcessMsg = DbImportUtil.importTemplate(template, file, sheet, messages, rollbackTransaction);

/*if (successfulProcessMsg != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the newly commented out code, can we just drop it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

@@ -118,16 +208,7 @@ public String processSubmit(@ModelAttribute("template") SpreadsheetImportTemplat
messageString += messages.get(i);
}
if (succeeded) {
messageString += "Success!";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intentionally remove all this block?

@@ -146,6 +146,8 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `spreadsheetimport_template_prespecified_value`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
# noinspection SqlNoDataSourceInspection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this used for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will investigate this. It seems to be an automatically added line by my editor.

<td><formsim:select path="prespecifiedValues[${status.index}].value">



<formsim:option value="" label="${prespecifiedValues[status.index].value}"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What could be the reason behind changing the label and value?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blanks all values even on the view/edit mode.

ojwangantony and others added 30 commits April 7, 2020 20:52
resolve failing vl/cd4 imports due to orphaned rows
complete processing of registration data
…tribute

Escape apostrophe in person attribute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants