OpenMRS Planet

July 25, 2017

Kwateng Ofori

Eighth Week of GSoC @ OpenMRS

This week I installed the module and do the testing. The swagger resources generator required several changes to compatible with the latest release.

After completing the swagger generator changes, I tested available resources and fixed bugs. I’m at final stages of the testing and need to move quickly to the next phase.

by Ofori Kwateng at July 25, 2017 02:32 AM

Chanuka Wijayakoon

GSoC 2017 – Week 8

Wow, two months gone just like that. This week, my focus was on implementing the pre-theater data collection as per our discussions over the previous weeks. If you followed along,  you’d remember that we decided to use concepts and obs groups to  record the collected data. The first thing I did was getting the patient’s …

by merovingienne at July 25, 2017 01:40 AM

Jai Tatia

WEEK 8 [19th July – 25th July]

This week involved studying AngularJs, which will be needed to create the UI Fragment, for the clinician facing Patient Dashboard. I learnt everything that will be required which includes:- Modules, Directives, Controllers, Databinding, Service, Filter, Http, etc.

Apart from this, I also begin to setup the module along with a reference application distribution, so that i can view the ui changes.
This required me to do the following :-

Using the SDK
First create a ref app distribution on a server using

mvn openmrs-sdk:setup

then put the module on watch

mvn openmrs-sdk:watch -DserverId=myserver

finally cd into the created module
then run

mvn clean install mvn openmrs-sdk:run -DserverId=myserver

also put port:xxxx for remote debugging, in IDE

However I seemed to face some kind of liquibase error which I trying to debug.
I also added the required dependencies, in the module along with a JSON file which will help in creating an extension to the secondColumnFragment in the clinician facing patient dashboard.


by jtatia at July 25, 2017 01:11 AM

July 24, 2017

Shivang Nagaria

API, Liquibase & OpenMRS

Hi All,

This week I was quite busy with my college work so I couldn’t do much GSoC work. This week I just took very light tasks and discussed future tasks with mentor.

My this week tasks are:

  • DINT-74: Improve the workflow for running single rule
  • DINT-82: Create and expose API of data integrity module

DINT-74

Right now the flow of running single rule is not very intuitive and informative. In this task, I need to think of a way which is more engaged and intuitive.

DINT-84

This one is quite interesting and challenging task. Although I did have some background in API and relative stuff but I don’t have much experience with it in context of OpenMRS systems.

That’s all for this week.

Thanks!

by Shivang Nagaria at July 24, 2017 08:11 PM

Reuben Varghese

WEEK -8 Updates [27th July — 3rd August]

Well the previous week was pretty hectic and kind of disrupted my time table a bit too. This was because of the sudden need of a new fix/task due to which I had to pause my existing work and work on.

College too has been very hectic over the past week.

Hopefully , I am able to complete the work ASAP.

Another thing to note is that the second evaluation is round the corner so I have to fill it in. Looking forward to the coming week with Gsoc @ OpenMRS!

by Reuben Varghese at July 24, 2017 07:06 PM

Choxmi Sathsara

GSoC @OpenMRS 8th week

This week was the most successful week. I was able to complete all the core functionalities of my project. Now the DHISReporting module has the capability to map the exported reports with the report module reports. Not only for sql query based report, but also for other Cohort reports.

Now any data element can be mapped with any existing indicator.

Mapping

Currently the elements mapped with other reporting indicators are displayed as an empty section. Now working on adding mapped report label to that section.

Mapped queries

I implemented the functionality to execute those reports when generating the report.

Generated report

Those are the achievements for this week. Next week I have to work on some UI changes which suggested by my mentor and continue writing test cases to the tickets I claimed.

That’s all for this week… :)

by Choxmi Sathsara at July 24, 2017 05:54 PM

Vishnu Mechineni

WEEK-2: The CORS issue.

Background:

As I  said before, my project is to develop a web application where end users can browse and download OpenMRS packages hosted on Bintray using the Bintray REST API.So I had to make AJAX (XMLHttpRequest) requests in order to communicate with the Bintray REST API.

Problem:

AJAX (XMLHttpRequest) requests have traditionally been limited to accessing the same domain as the parent web page (as per the same-origin security policy). “Cross-domain” AJAX requests are forbidden by default because of their ability to perform advanced requests (POST, PUT, DELETE and other types of HTTP requests, along with specifying custom HTTP headers) that introduce many cross-site scripting security issues.

I have communicated with Bintray support only to know that CORS standard is not supported by Bintray yet and that they will be adding this feature by month end.

Solution:

The response from the remote server to which we are making AJAX calls should have headers like this

  1. Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type, Accept
  2. Access-Control-Allow-Origin:*

Screenshot (437).png

The solution is to develop a proxy server which will add the required headers to the responses received from Bintray.

So I have developed a proxy server using the Expressjs framework which exposes REST endpoints from where I called  api.bintray.com  and added the required header’s to the response received from Bintray.

Here’s the final setup,My web app will be running on a port(say localhost:8000) and my proxy server on port(say localhost:3000). I will call rest endpoint exposed by proxy server  (localhost:3000/packages )  from my script in webapp (localhost:8000). The endpoint at (localhost:3000/packages )  contains code to communicate with Bintray, When the proxy server receives response from Bintray it will add required headers ( have a look at http://enable-cors.org/server_expressjs.html) and send it to browser.

I would like to thank Saptarshi and Rafal for guiding me through this blocker.

For more info on CORS also read:

http://blog.javascripting.com/2015/01/17/dont-hassle-with-cors/

enable-cors.org

https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS


by reevolter at July 24, 2017 05:50 PM

Suthagar Kailayapathy

Module Update with OpenMRS Add Ons

Week 8 [July 17, 2017 — July 24, 2017]

I spent this week with SysAdmin OWA. Because there are some problems encountered according to the module updates. When User trying to check the module updates, It shows some unexpected error,

My mentor asked me to investigate this problem and find some solutions to avoid this problem.

Here I have used modules.openmrs.org to retrieve the required module information. There is a REST endpoint which can be used to get the module details from the online server. This REST endpoint will give us these following details,

  1. Module download URL
  2. Module Name
  3. Current/Latest version of the Module
  4. Module Owner/Creator
  5. Module description

The final REST response will be like this,

REST End point already developed with some different kind of metadata. They have used UID to indicated the module. But for some modules, those defined UID in the REST endpoint was different from actual UID in the system. So when I am trying to get details using actual UID, It’s response to the user as Error. This is the reason for this problem

OpenMRS | Add Ons

OpenMRS Community is going to retire the modules.openmrs.org platform. They are developing OpenMRS Add Ons Platform which can be used instead of modules.openmrs.org.

Adding user’s module to Add Ons for indexing is as easy as creating a pull request! Before they do that, they need to ensure that their module has been hosted on one of the sites that Add Ons currently supports indexing from:
1. Bintray
2. modules.openmrs.org

Once they have confirmed the above prerequisite, they can head over to the Publishing an Add on document on Github which contains a comprehensive list of steps.

Using OpenMRS Add Ons for Updates Purpose

After some discussions about the current UID problem with my mentor Daniel, There is another precious Idea mentioned by Darius in my talk thread. That is using OpenMRS Add Ons platform instead of module.openmrs.org platform.

OpenMRS Add Ons platform already contains some REST Endpoints which are based on module.openmrs.org. It can be used to get information about the modules using moduleID which is similar to the actual module’s package name.

https://addons.openmrs.org/api/v1/{moduleID}

But for some modules, I can’t get details for some modules using their package name

I can get details using package name(or UID) for some modules,

  1. Atlas Module (package : org.openmrs.module.atlas ) — URL : https://addons.openmrs.org/api/v1/addon/org.openmrs.module.atlas
  2. UI Commons Module (package : org.openmrs.module.uicommons ) — URL :https://addons.openmrs.org/api/v1/addon/org.openmrs.module.uicommons

But I can’t get modules details for this module using package name or UID

  1. Legacy Module(package name : org.openmrs.module.legacyui ) :
    Original URL : https://addons.openmrs.org/api/v1/addon/org.openmrs.module.legacy-ui-module1
  2. Data Exchange Module (package name : org.openmrs.module.dataexchange)
    Original URL : https://addons.openmrs.org/api/v1/addon/org.openmrs.module.data-exchange-module

Here the problem is, They have predefined those UID which is similar to the module’s package name but It differed to some modules. Predefined module data JSON file is given below,

openmrs/openmrs-contrib-addonindex

So after some discussions with Darius, He promised to provide another REST endpoint which can be used with actual module package names. The REST endpoint will be like this following,

https://addons.openmrs.org/api/v1/addon?type=OMOD&modulePackage={x}

So I am waiting to that REST endpoint to complete the Updates part in SysAdmin OWA.

Follow this talk thread to get more information and discussions about the module update using OpenMRS Add Ons.

GSoC 2017 - More Metadata Management in AdminUI

by Suthagar Kailayapathy at July 24, 2017 04:58 PM

Nipun Thathsara

Testing the solution

I've implemented the solution up to an extent, now that's the time to put the pieces together and run the system. But proceeding forward got a problem when building the each module and core.

The core and the registrationApp both has the maven repository's copy of their respective dependencies. These repos do not include my changes. therefore, i have to build these repos locally and add themselves as the dependencies accordingly.

But the core builds up as a war file not a jar. Therefore, i've faced a difficulty in adding them as a library in the other modules. I've contacted the mentor and asked from the community as well.

https://talk.openmrs.org/t/changes-in-core-doesnt-reflect-in-modules/12473


Got an answer from the community and i'm going to check it out tomorrow and test if the current implementation is working fine or not.

Other difficulty that i'm facing is debugging the OpenMRS. As it's running on top of core and multiple modules, it doesn't have a single code base but many. Therefore, debugging is not as easy as normal web app. I've searched the internet but could found only one blog barely describing the REMOTE DEBUGGING process. I've talked to the mentor about this and hopefully we can find a solution for this soon.

In this week i'll be building the solution and test if it works or not. Will give an update once done.


by Nipun Thathsara (noreply@blogger.com) at July 24, 2017 04:57 PM

Xu Hao

Open Concept Lab enhancements — The 8th Week of GSoC 2017

Time flies. This week is the last week of the second coding period, and I have done lots of things to complete the second project objective. As mentioned last week blog, This week I focus on the coding work, and I do works likes said following:

  • I write a detailed proposal about the second objective and my technologies. As I am not familiar with the project, I did not write this in last evaluation, mentor Jon said that he wishes that I give him a detailed proposal in evaluation. So I do this, and complete some mockups.
  • The most important is coding, I use AngularJS, HTML and CSS to complete the html view, and to interact with web back-end. I think it is nice to me because this is my first time to use AngularJS in a project.
  • The third work is that I completed the functions like concepts and mappings differences viewer. In last month, Jon had said to me that he is looking forward this objective. It is wonderful to us to see the differences of concept and mapping graphically.

There are also many works in the second objective: diff viewer, like concepts and mappings selection, compare details. And I won’t put them here, as detail are listed in the proposal. The blog records my work and my sweat, it is enough.

In the end, Jon gives me a lot help, and guides. And our community is helpful to us to get solutions about some problems. Thanks to Jon, and all of people who are enthusiastic。

by Xu Hao at July 24, 2017 03:51 PM

Ayush Goyal

GSoC Week — 8

This week I completed the app demo. In my previous PR my mentor mentioned to use buttons for switching to next showcase view but the previous library I used[1] there was no option to do that so I switched to a new library[2]. It was way more customizable then the previous one. So I shifted to it and everything was working fine but to test it properly I had to clear the app data and then I was not able to login to app again for further testing.I was always getting the error of invalid credentials but strange thing is everything was working fine on the website.I tried three different devices on two different networks, I also tried with the app published on play store but no luck. So, I made a new thread on the talk forum[3] and the issue is still not resolved.

I also completed the forms creating on the server if they are not present from within the app only but I had not pushed the code to the GitHub because due to login problem I was not able to test it properly.

I also read about the provider module in the meantime so that it will further escalate progress afterwards.

References :

[1]https://github.com/deano2390/MaterialShowcaseView

[2]https://github.com/amlcurran/ShowcaseView

[3]https://talk.openmrs.org/t/login-error-on-qa-refapp/12531

by Ayush Goyal at July 24, 2017 03:27 PM

Ankit Kumar

Week 8 - Solved some major bugs in the tests

At the time of writing tests using jasmine and karma, I faced a lot of hindrances in the form of some of the unknown errors. But, the error which took me a lot of time to solve was the "Transition Superseded Error". The reason due to which it took me time was because my tests were fine and was running successfully on angular version 1.5.x without the above errors but wasn't running on the angular versions above 1.6. I searched a lot for the solution but was only getting one solution and that was to try upgrading the angular-ui-router and angular versions. I tried everything and I also tried uninstalling and reinstalling the node and npm but nothing served any help. After some time, I came across a solution at "Stack Overflow" in which a coder was suggesting to add the following code into the config file :

$qProvider.errorOnUnhandledRejections(false);

I then tried adding this into my home.js file (where all the components and module information was present) and it worked like a charm. This was the code part :

.config(['$qProvider', function ($qProvider) {
      $qProvider.errorOnUnhandledRejections(false);
    }])

Reason for this code to work :

According to my research, the main reason why this code solved the error was because, this code gives the REST calls a subsequent chance to try before throwing an error due to rejection. In case if REST call fails to get the required data, it tries again and if again it fails due to some reasons, it will throw an error (which is genuine).

Apart from solving this error, I went through the FHIR module because my next part of this project will be to add the FHIR support to the OWA generated through the openmrs OWA generator.

I have send a combined PR and waiting for it to get reviewed by my mentor.
Here is the link to the PR :

https://github.com/psbrandt/generator-openmrs-owa/pull/30

Thanks
Ankit Kumar

by Ankit Kumar (noreply@blogger.com) at July 24, 2017 11:55 AM

Jude Niroshan

[GSoC-2017: 8th week] Built-In Reports for Reference Application OpenMRS

This week I was primarily focus on multiple tasks. Basically my intention was to implement the navigation among the different report pages inside the OWA. I was able to complete in using the latest React router v4 dom library. So, Now the pages are available and users can smoothly navigate through them.

I have created a new thread to get feedback on how the reporting UIs is going to display.

Feedback on built-in reports for reference app wireframes

There was a minor style issue and fixed it. While working on these, I found out that 3 reports is not rendering. I observed that this is because those reports were accepting the location as a parameter. Even though I pass the location as just string parameter inside a json, it is not recognized. As my mentor advised me not to spend more than 3 hours on a problem, I raised this problem which I was facing.

How to pass Location object from OWA to reporting REST API

At the same time I found another issue where the dates from the Reporting REST API is not returned as formatted properly. So, I created another issue in JIRA. My mentor replied me to work on this issue first and resolve the date formatting issue first. So, Currently I’m working on this.

by Jude Niroshan at July 24, 2017 06:42 AM

July 23, 2017

Lahiru Jayathilake

Week 8: Game is almost done

I have completed almost all of the tasks that I have included in the project plan and made the third pull request. The pull request is for PTM-84 and after doing this task, patient matching module supports to match patients incrementally.    

To complete this task I had to change the MatchingReportUtils.java class in the patient matching module. Those changes can be found here.

What I have done up to now?
So far I have completed,

  • PTM-82 - Load patients for the incremental matching
  • PTM-83 - Generate and save reports in incremental patient matching process
  • PTM-84 - Perform patient match with two datasources


by Lahiru Jayathilake (noreply@blogger.com) at July 23, 2017 04:00 PM

July 19, 2017

Chanuka Wijayakoon

GSoC 2017 – Week 7

During the 7th week, I got feedback on the mock-ups for pre-theater data collection. Just as I suspected, letting the user simply note data as free text was not the best idea. Although a simple note might be useful in communicating the patient history, it’s not usable for analytical purposes. I mean, a text paragraph …

by merovingienne at July 19, 2017 05:35 AM

July 18, 2017

Choxmi Sathsara

GSoC @OpenMRS 7th week

This week I did some changes to the code I committed regarding DRM-09 and DRM-28 tickets as Daniel suggested to do. After having a discussion with my mentor, I started to work on second phase of the project which is to map other report types other than SQLCohortDefinitions.

Currently I have implemented a method to execute and display the report results. Next thing I am going to work on is to display the executed report results in DHISReportingModule report.

I have to work on writing test cases for the previous tickets as well. That’s all for this week… :)

by Choxmi Sathsara at July 18, 2017 05:04 AM

Jai Tatia

WEEK 7 [12th July – 18th July]

 

This week involved me continuing my work on the REST API. After another call with my mentor we were able to organize our efforts and finally come up with How the resource will work. This week also involved me cleaning up the restApi Code So that it could be finally merged. It is finally at the end and the code will be merged my today or tomorrow. With that I can start my work on the UI Fragments. I have already recognized the dependencies that will be needed.
The REST Resource will support searching by :-
1) objectType and objectUuid
2)objectType and tagName


by jtatia at July 18, 2017 12:49 AM

July 17, 2017

Kwateng Ofori

Seventh Week of GSoC @ OpenMRS

This week I dedicated to test the module. After the version upgrade of the HAPI FHIR library, I encountered several issues during module loading. My mentor asked me to do comprehensive testing for the module. So I’m checking all the available resource and their operations.

by Ofori Kwateng at July 17, 2017 09:52 PM

Reuben Varghese

WEEK -7 Updates [19th July — 26th July]

This week was all about writing tests for my previously commited work. I also had to make some changes in the UI workflow as pointed out by my mentor Darius. I was initially really stuck at some places because I really couldn’t figure everything out from the documentation available online.

I am also a newbie when it comes to testing and hence had to take some time off to understand the meaning and usage of the different testing tools out there for java. My mentor asked me to stick to Spring based testing as far as possible and that was a greater challenge for me as it make finding relevant examples all the more tougher. None the less, although it took me some time, I can proudly say at the end of this week that I have been successful in creating tests for my use case. Technically speaking, I should’ve followed the TDD approach as pointed out by my mentor and will keep that in mind for future changes.

I also improved the UI . The select option is now disabled if there are no module versions which support the User given OpenMRS Core version.

All in all, this week can be summarised as productive but not really the best when it comes to efficiency( can be attributed to the fact that my college has reopened and hence it took me time to settle in). I hope to speed up the work the coming week. On to week 8 with Gsoc @ OpenMRS!

by Reuben Varghese at July 17, 2017 06:40 PM

Suthagar Kailayapathy

Complete the SysAdmin — Final Stage

Week 7 [July 10, 2017 — July 17, 2017]

This week also I wanted to work with SysAdmin OWA module. Because my mentor Daniel wanted to make this better for Production level. At the beginning of the week, I received some feed backs from Darius and my Mentor Danieal.

Working with my mentor Daneial

He was very active to guide me about the module. The major problem encountered by him was wrong Alert Messages contents. I displayed an alert message when a user triggers Delete/Stop module buttons. These alerts messages contain some module names.

There are two type of module lists inside the Module Details JSON object, That are,

  • Required Modules — A module can only access the API/service of another module if it is marked as required.
  • Aware of Module — This means that if the other module is also installed, do some extra features in Atlas module

Initially, I just displayed those Required Modules list as the affected modules. But he encountered that was wrong. I can’t figure out that concept immediately, but after some discussions, I can understand the concept of dependent modules. Pseudo code for the concept is,

Get module package name A
Get all modules data
Loop all modules data {
Get required modules data B
check weather package name A is in the list B {
Add modules name to display
}
}
}

Then I have implemented Dependent Module list inside the Module View details page as follows.

Working with Darius

Darius mentioned some GUI enhancements which will lead to SysAdmin better. He observed deeply and suggested some feed backs to improve my OWA. Some of the main objective from his view are,

  • Remove the red color for Delete/Stop button. Because It may avoid the eye contact from other parts of the module.
  • Be consistent about whether we’re going to have Icon and Text for Start, Stop, and Delete.
  • All actions buttons should be inside the one column.

So I completed those changes and asked him again for the reviews.

New Features

One of the new feature is Dependent Module data and another one is Getting module information from Online.

In the module view details, there are a lot of modules will be displayed under Required Modules and Aware of Modules. Some of those modules might not be installed on the server at that time. So when user click those modules, OWA wanted to face some Exceptions. So to handle this problem, I have implemented Get Details from the Online option.

It will gather details from Online OpenMRS module’s repository and will show it to the user as follows,

Happiness is getting some greetings from my mentor like this :-p ,

by Suthagar Kailayapathy at July 17, 2017 05:50 PM

Shivang Nagaria

Rolling out new version of Data Integrity Module

Hello everyone!

This week I worked on DINT-80 which was relatively easy issue, I just needed to remove hardcoded strings and replace them with variable which fetches localised strings. Just after merging respective PR, my mentor released new version of Data Integrity Module . There are some major updated in Data Integrity Module — 4.4.1 which are:

  • Now users can filter the data integrity results by patient name, program name , by rule name and even by free text search.
  • Filtered/Unfiltered result can be exported to CSV, Excel and PDF for offline and other usage.
  • Some small fixes like improving styling of data quality dashboard and localising the hard-coded strings.

This week I’ll working on DINT-75 which is again a new stuff for me but I hope with the help of OpenMRS community I’ll able to complete it.

Links to all relevant pull requests:

Thanks!

Useful Links

by Shivang Nagaria at July 17, 2017 05:22 PM

Nipun Thathsara

Coding the core and RegistrationApp ...

Contd from last week..

CORE
Last week i've roughly changed savePatient method in the Core, so that i can get the opinion of my mentor before continue the approach. Therefore, i didn't resolve all the  dependencies.

Since we both agreed on the solution, here i've implemented it further more, 
  • Resolved all the dependency errors.
  • Unknown variable is yet to be passed to the core's method.
  • Adding the Unknown attribute - which is originally done in the registration app is moved here.
  • But, since emrAPI is not available in the core, i had to take the workaround method.
TODO
  • savePatient method of core is being used for functinalities other than registering the patient. 
  • If i add a second parameter for 'unknown boolean', other use cases like EditPAtient will not work.
  • Therefore, the only solution seems to be overloading the savePatient method with two separate arguments.
  • This has to be done in future.

      @Override  
public Patient savePatient(Patient patient) throws APIException {
//************work starts
//todo
//pass unknown att to core - is paasing along regCore as a separate para is ok?
if (unknown != null && unknown) {
PersonName name = new PersonName();
name.setFamilyName("UNKNOWN");
name.setGivenName("UNKNOWN");
patient.addName(name);
//patient.addAttribute(new PersonAttribute(emrApiProperties.getUnknownPatientPersonAttributeType(), "true"));
//work on addingAttribute - core can not depend on the relevant module. therefore rewriting that...
PersonAttributeType type = null;
type = this.personService.getPersonAttributeTypeByName("Unknown patient");
if(type == null) {
throw new IllegalStateException("Configuration required: Unknown patient");
} else {
//return type;
patient.addAttribute(new PersonAttribute(type, "true");
}
//resolve errors
}
//************work ends



REGISTRATIONAPP

Commentd out all the logic related to unknown patient registration from the registration app. This logic is moved t the core.
TODO

  • Unknown boolean has to be passed  to the registrationcore and from there to core itself. So, registration core also should either be overloaded, or add another boolean parameter to itself.


   public FragmentActionResult submit(UiSessionContext sessionContext, @RequestParam(value="appId") AppDescriptor app,  
@SpringBean("registrationCoreService") RegistrationCoreService registrationService,
@ModelAttribute("patient") @BindParams Patient patient,
@ModelAttribute("personName") @BindParams PersonName name,
@ModelAttribute("personAddress") @BindParams PersonAddress address,
@RequestParam(value="birthdateYears", required = false) Integer birthdateYears,
@RequestParam(value="birthdateMonths", required = false) Integer birthdateMonths,
@RequestParam(value="registrationDate", required = false) Date registrationDate,
@RequestParam(value="unknown", required = false) Boolean unknown,
@RequestParam(value="patientIdentifier", required = false) String patientIdentifier,
HttpServletRequest request,
@SpringBean("messageSourceService") MessageSourceService messageSourceService,
@SpringBean("encounterService") EncounterService encounterService,
@SpringBean("obsService") ObsService obsService,
@SpringBean("conceptService") ConceptService conceptService,
@SpringBean("emrApiProperties") EmrApiProperties emrApiProperties,
@SpringBean("patientValidator") PatientValidator patientValidator, UiUtils ui) throws Exception {
NavigableFormStructure formStructure = RegisterPatientFormBuilder.buildFormStructure(app);
// if (unknown != null && unknown) {
// // TODO make "UNKNOWN" be configurable
// name.setFamilyName("UNKNOWN");
// name.setGivenName("UNKNOWN");
// patient.addAttribute(new PersonAttribute(emrApiProperties.getUnknownPatientPersonAttributeType(), "true"));
// }
//
// patient.addName(name);
patient.addAddress(address);

by Nipun Thathsara (noreply@blogger.com) at July 17, 2017 04:13 PM

Ayush Goyal

GSoC-Week 7

To help the new users know and utilise all the functionalities of the android app a proper app demo is necessary. So, this week I used MaterialShowcaseView library[1] and added the app demo. Below are the few screenshots of the same.

Also I have almost fixed the forms bug and will send the PR in some time after properly reviewing the code.

by Ayush Goyal at July 17, 2017 03:27 PM

Xu Hao

Open Concept Lab enhancements — The 7th Week of GSoC 2017

It is useful to record every week’s progress for me. And this is the newest blog to record what I did this week and what I will do next week. And I realize that writing blog with English is also good to be familiar with English for me, because my English is not good.

At first, I must say a good new about my family, it is that a new baby was born this week in my family, I can not express my happiness. So I went back home to visit the wonderful new mom, my old sister. I want to share the good new to everyone.

OK, let’s be back my work. I have to say the new baby consume some my work time, LOL. I have learned the work listed in last week blog, and I won’t write them again. Following are my some new work:

  1. I searched some implement idea from Google and Baidu, and I have some ideas about the second task.
  2. I am working on the second task’s mockup and proposal, because mentor Jon said that he hoped to get a specific proposal when submit one task.
  3. Some work about coding, I have implement some basic function about the task, like get the concepts which will be compared.

Next week, I will work more, because there are many work to do. I will do

  1. complete the project mockup
  2. complete the project proposal
  3. coding to implement the function

OK. That’s all, I have to say, I must to work much time to complete my second task, LOL, but I enjoy it. Work is better to waste my life. Thank you.

by Xu Hao at July 17, 2017 01:49 PM

Sanatt Abrol

Week 7 Grant types issue fixed, authorization problem

I was unable to work as much as I desired this week due to illness and all the mess I had to sort out after moving into my new hostel.

This week, I fixed the grant types issue in the UI frame. Now, we have a working client registration using UI and the next problem is the Authorization errors. For example, consider the following GET token request :

http://localhost:8080/openmrs/ws/oauth/token?grant_type=password&client_id=app10&username=admin&password=Admin123

and adding the client credentials in the header in an encoded form, I get a stack trace as JSON. The notable line in this stack trace is

      {

 

            “methodName”: “authenticate”,

 

            “fileName”: “UserAuthenticationServiceImpl.java”,

 

            “lineNumber”: 35,

 

            “className”: “org.openmrs.module.oauth2.api.impl.UserAuthenticationServiceImpl”,

 

            “nativeMethod”: false

 

        }
The full stack trace can be found at https://pastebin.com/kr5BPaWN
The line states User user = Context.getUserService().getUserByUsername(username);
The error is that I am unable to fetch the appropriate user from OpenMRS context by giving username as the param.
Next course of action : I think this error is the final piece of jigsaw in successfully migrating the module to OpenMRS 2.x I’ll have to put in extra efforts this week to ensure that I can start work on SMART app the following week.

The post Week 7 Grant types issue fixed, authorization problem appeared first on Sanatt Abrol.

by sanattabrol at July 17, 2017 05:30 AM

Jude Niroshan

[GSoC-2017: 7th week] Built-In Reports for Reference Application OpenMRS

Last week I was trying to fetch data and show them in OWA which I have created now. We had the weekly meeting with my mentor, and showed him about the project structure. He modified the package.json file which needed to add some dependencies.

I was able to create the components for each of the reports which I have created in referenceMetaData module. I was glad that I could complete it. I updated the OpenMRS talk thread, and I saw that it has been updated since my last comment was 15 days back. I think I need more attention to my project work right now.

I have created a very basic structure for those components as shown like here. My mentor told that we don’t need to focus much on styling yet, but to fetch the data from server module.

I think, I was able to complete what we have targeted for this week. Now I am looking to implement the routing feature from navigation bar to display the relevant components when it has been clicked. Tomorrow we have our weekly meeting for this week and I hope to get feedback on this from my mentors.

by Jude Niroshan at July 17, 2017 05:27 AM

Ankit Kumar

Week 7 - Writing tests for the components

After designing the components, I started writing tests for them and also manipulating the components as per the tests requirements. In previous blog post, I mentioned that I have been started writing tests using mocha and chai. But due to some of the unwanted and unresolved errors, I consulted my mentor for setting up a proper testing environment. As per his suggestions, I decided to move forward with the Jasmine and karma testing environment. While setting up the jasmine and karma environment too, I faced a lot of errors. Some of them were :
"webpackJsonp not defined" which was resolved by using a part of the webpack in the karma.conf file ignoring the input, output and "vendor" part of the webpack.
After that I came across an error which was "transition superseded" error. It was quite difficult to overcome this error as there was no clue provided in the error log stack and when I went to search the solution for this error on the Google, I was getting a variety of solutions for that. Checking all of them was not feasible so I tried experimenting with the dependencies involved in the package.json file.
Fortunately, I tried to run the npm commands manually, and I got the solution to that error (a temporary solution) which eliminated some of the possibilities of the errors which was roaming into my mind at that moment. It gave me a sigh of relief. Its still an issue but a workaround exists and I am currently discussing with my mentor on this issue.
I have basically tested the REST part of the components (which is the main part) along with the functions I have used in the components. Tests ran successfully without any error !! :)

Apart from writing the tests, I also introduced a loading functionality into the components during the period they make the REST calls. This will help the users getting a better experience. It will be showing a loading gif (downloaded from the google) whenever the components will take time in providing the search results.

My next aim is to first discuss the solution of the error ("transition superseded") with my mentor and to resolve it as soon as possible. Then, I will move towards my next part of the project that is devising a way to use FHIR module into the webapp !!

Thanks,
Ankit Kumar

by Ankit Kumar (noreply@blogger.com) at July 17, 2017 04:53 AM

July 16, 2017

Lahiru Jayathilake

Week 7: Game of Codes ;)

The tasks that I have aforementioned in my 5th week's blog post, have already been completed. The main target in PTM-84 task is to make patient matching module to deal with two datasources. The importance of this process has been mentioned in my 5th week blog post

I had to change 6 methods in MatchingReportUtils.java. Methods are listed below. 
  1. InitScratchTable
  2. CreRanSamAnalyzer
  3. CreAnalFormPairs
  4. CrePairdataSourAnalyzer
  5. ScoringData
  6. CreatingReport
Every method indicated above should support for both deduplication as well as for two datasources. Deduplication process is needed in the incremental patient matching process at the first time since every patient record is being matched with every other record. Not only that if the user specifically indicates to run the patient match for all the records, deduplication process is the one should carry out the task.

Power of the incremental patient matching comes with two datasources. One datasource is comprised with all the patients while the other datasource contains only the patients who are added or changed after the last execution date of the report.

What I have done ?

The changes that I have done for the patient matching module to get this work done can be found here.


by Lahiru Jayathilake (noreply@blogger.com) at July 16, 2017 06:18 PM

July 11, 2017

Reuben Varghese

WEEK -6 Updates [11th July — 18th July]

6 weeks into Gsoc and I still learn new things each week! So this week was all about modifying my previous commits as per my mentor’s feedback on my Pull Requests. This week , I also learned as to how to place code where and as to how to write unit tests for Spring applications(I did know how to write them even before but I needed to know the difference between a unit test and an Integration test) . I also had a call with my mentor which was indeed very productive.

Next week I will be focusing on using the Bintray rest API to fetch details like download counts etc . Since we have finally migrated all OpenMRS modules to Bintray(Thanks to Rafal :)), we will sl0wly migrate from OpenMRS modulus to Bintray. Hopefully this process will be smooth.

I was also a bit busy as I had to pack my bags and move back to college for the next semester so basically that marked an end of my summer vacations :(

I look forward to the next week as we have a lot in store. So , on to week 7 with Gsoc@OpenMRS !

by Reuben Varghese at July 11, 2017 07:45 AM

July 10, 2017

Shivang Nagaria

Sass, Compass & OpenMRS

GSoC’17@OpenMRS — Week Six

Hi everyone!

This week I worked on DINT-76 which again involves work related to datatables. More specifically, I need to add capability to export the filtered list in different formats such as CSV, Excel and PDF.

I started looking for different options then my mentor pointed me to the export feature provided by button library of datatables.

Data exported in PDF format

With the help of datatables, it was just matter of minutes to add export capability but real work involved improving the look of the export buttons. By default they look very ugly and non-intuitive.

Export option given in Excel, CSV and PDF

Final look of the export buttons — attractive and intuitive.

OpenMRS doesn’t have icons for excel, csv and pdf inbuilt so I need to add them in the data integrity module. I dig little bit and asked around and came across sass and compass. Again, during GSoC I came a technology I wasn’t familiar with.

I used the fontello.com for generating required icons files such as svg, ttf and woff, etc. I also took me a while to learn about sass and compass. After that I just need to tweak default config to setup it according to our need — like adding filename, title and tooltip. Today, it got merged and will go in the productions. Next I will start working on DINT-80.

Useful Links

by Shivang Nagaria at July 10, 2017 06:24 PM

Jai Tatia

WEEK 6 [5th July – 11th July]

In the Design call held on the 5th of July, a discussion was held on the way forward regarding the Generic-Tagging-Mechanism Project. It was decided that instead of working on Angular directives, the first step would be to add this mechanism to the clinician facing patient dashboard. The plan is to create a fragment in the tagging module and to provide an extension point to the secondColumnFragment in the clinician facing patient dashboard :-

Apart from that several changes were decided for the Rest Resource. I added searching capability by 3 parameters objectType, objectUuid, and tagName. Depending on which parameters are provided a List of tags will be returned. I also started cleaning up the Rest Api code according to the Code Review. The representation was also modified.

For full representation
GET .../v1/tag?tag=my-favorites?v=full

[

{
“uuid”: “uuid-of-tag-object”,
“tag”: “my-favorites”,
“objectType”: “patient”,
“objectUuid”: “…/patient/uuid-of-tagged-patient”,
“auditInfo”: “”
},
{
“uuid”: “uuid-of-tag-object”,
“tag”: “my-favorites-of-all”,
“objectType”: “concept”,
“objectUuid”: “…/patient/uuid-of-tagged-concept”,
“auditInfo”: “”
}
]

For Default Representation
GET .../v1/tag/my-favorites

{
“tag”: “my-favorites”,
“links”: [
{“rel”: “patient”, “uri”: “…/patient/uuid-of-tagged-patient”},
{“rel”: “concept”, “uri”: “…/patient/uuid-of-tagged-concept”}
//….
]
}

I still have a few doubts regarding the default representation, but other that that the Rest part is almost complete. I have also started looking into how I will add the UI fragment. For this I am using Allergies UI and the tagging mechanism of JIRA as reference.


by jtatia at July 10, 2017 05:50 PM

Chanuka Wijayakoon

GSoC 2017 – Week 6

It’s the end of the 6th week and I’m happy to bring some UI to the mix. Up until now we’ve been working with the stuff that was made before. But now it’s time for new enhancements. The first part of it is enhancing the pre-theater workflow. Along that line, we discussed what data need …

by merovingienne at July 10, 2017 05:27 PM

Ayush Goyal

GSOC-Week 6

This week was very hectic ! I travelled a lot this week in fact right now also I am writing this blog post from train. I was at my home and due to some family issues I was not able to work properly but still I managed to get some of the work done.

I read the documentation on the provider module and the appointment module from the Openmrs wiki which will help in escalating the speed of my work when I will implement them.

Currently the vitals forms has to be added manually on the Openmrs server which is a bit tedious task and also the problem is if the JSON form is not present, then the app doesn’t display any form at all, so to resolve this issue it is decided that if the HTTP request gives a null value then the form should be generated on the client side i.e. in the app.

To implement this I started test on qa-refapp server through Postman but for some reasons I was getting a 403, I reported about this and Rafal told that he is not facing any problem with the server and everything is fine. So, I again tried with it but got the same error ! Rafal posted the request he was using and now I can debug the issue properly and finally get to know what I was doing wrong.

I will fix this and then implement the rendering of the forms on the app in a day or two and now I have to devote more time as it has put behind my schedule.

by Ayush Goyal at July 10, 2017 03:52 PM

Nipun Thathsara

Starting with core

As explained in the previous post, the dependency with registration module when saving an unknown patient is, setting its given name and family to UNKNOWN in the registration app. this should be done in the core.

To identify the saving patient is an unknow in the core, unknown boolean has to passed to the core through registration app > registrationCore > core. Assuming the unknown status is passed to the core, validating whether patient is unknown and if so, setting name and unknown attribute is done in  the core. Which are previously done in the registrationApp.

 @Override  
public Patient savePatient(Patient patient) throws APIException {
//************work starts
//todo
//pass unknown att to core - is paasing along regCore as a separate para is ok?
if (unknown != null && unknown) {
PersonName name = new PersonName();
name.setFamilyName("UNKNOWN");
name.setGivenName("UNKNOWN");
patient.addName(name);
//patient.addAttribute(new PersonAttribute(emrApiProperties.getUnknownPatientPersonAttributeType(), "true"));
//work on addingAttribute - core can not depend on the relevant module. therefore rewrite that...
PersonAttributeType type = null;
type = this.personService.getPersonAttributeTypeByName("Unknown patient");
if(type == null) {
throw new IllegalStateException("Configuration required: Unknown patient");
} else {
return type;
}
//resolve errors
}

Here, unknown boolean has yet to be passed to the core.

But emrApi properties is not visible in this scope since it is in a different module. Therefore, re implementing the logic again in here. Dependencies are still to be resolved.

May be i should start from the beginning, from registration app and come down the way. idk.


by Nipun Thathsara (noreply@blogger.com) at July 10, 2017 02:38 PM

Xu Hao

Open Concept Lab enhancements — The 6th Week of GSoC 2017

As the last blog said that I need to cost 2 weeks to learn how to use AngularJS. I am glad that this I can be familiar with the AngularJS within two weeks. So it’s time to end the learning period, and start my second task.

This week I have learned some knowledges about the rest of AngularJS, like

  • Service : A little confused
  • HTML DOM
  • Bootstrap
  • event
  • form

I believe that I can implement the second task with these basics I learned these two weeks. In fact, I have to say, javascript is powerful for web applications.

It is better to have a plan for the next week. I hope I can understand the whole requirement about the second task. And I have to an complete idea about it, implement a specific technical proposal. Maybe I have time to code few to implement a part of this task.

That’s all, I think all the technical detail will record in next week blog. Thank you for all the people who care about me.

by Xu Hao at July 10, 2017 01:47 PM

Lahiru Jayathilake

Week 6: One more datasource!

According to my last week post I need to change few methods in patient matching module, in order to have a patient match with two datasources. So I started with following methods in MatchingReportUtils.java
  1. InitScratchTable
  2. CreRanSamAnalyzer
  3. CreAnalFormPairs
  4. CrePairdataSourAnalyzer
  5. ScoringData
  6. CreatingReport
Following code shows how I changed the code to support for both deduplication as well as for two datasources.

This code segment was added inside the InitScratchTable,

CreRanSamAnalyzer method was changed as follows,

by Lahiru Jayathilake (noreply@blogger.com) at July 10, 2017 09:12 AM

Suthagar Kailayapathy

System Administration OWA — Final Stage

Make SysAdmin better!

Week 6 [July 03, 2017 — July 10, 2017]

After the First evaluation, I have started again my works under my mentor Daniel Kayiwa. There are some tasks according to my timeline, but he advised me to complete the SysAdmin reviews and improvements before moving to the new stage of the development.

According to my mentor reviews, I got some import GUI bugs and latency problems such as,

  1. Anyone can delete installed modules without any confirmation
  2. Header fonts differ from Existing Open Web Apps
  3. Breadcrumbs contains hyperlink for active pages also and There are two Home buttons displayed (One as Home image and other One as ‘Home’ text)
  4. Initial Page loading latency and some ugly characters printed before data fetching
  5. Show module names in the pages instead of module legacy-ID

So I investigated those mistakes and problems and find out the corrections. Then after I updated my modules with Daniel’s feedback. You can check the feedback and my updated information through this following OpenMRS Talk thread,

GSoC 2017 - More Metadata Management in AdminUI

Major Updates — SysAdmin

  • Implemented user Confirmation before delete modules
Updated Confirmation Message
  • Implemented user alerts when user try to STOP some modules

Now I have completed this following parts in SysOWA,

  • Module Management -
    All Module Details — Start/Stop Module, Delete Module, Check Module updates, and Start All modules
    Selected Module View — All details of selected module, Start/Stop Module, Check for Module update
    Upload New Module
    Search and Install New modules
  • System Information

I am working with Encounters and Observations along to this improvements. Completed parts in the OpenMRS Encounters,

  1. Encounter Search/Add/Edit
  2. Encounter Type Management
  3. Encounter Roles Management

This week I planned to complete Encounters and Observations :-)

by Suthagar Kailayapathy at July 10, 2017 08:55 AM

Ankit Kumar

Week - 6 - All about designing and testing components

This week was the most exhaustive as well as productive week so far. I improved the patient search component and also designed new components like Encounter Search, Observation Search and Provider Search apart from the patient search.

Now, this is what my components look like :

Patient Search :




Encounter Search :



Obseravtion Search :



Provider Search :



Apart from designing these components, I am writing the tests alongside with mocha and chai. Currently stuck at some error related to the mocha, chai and jsdom environment setup !! Hoping to resolve it soon. Most Probably I will be done with the tests at the end of the upcoming week !!

Thanks !!
Ankit Kumar

by Ankit Kumar (noreply@blogger.com) at July 10, 2017 08:45 AM

Suthagar Kailayapathy

Get Your Amazon Cloud Watch Logs Today!

Best way to Manage your Logs using WSO2 Integration Cloud

This is my second week of Internship at WSo2 and I have implemented a simple dashboard which can retrieve and show the logs from AWS CloudWatchLog.

Dashboard to show Log Groups, Log Streams and Log Events with Filters

AWS CloudWatchLogs API

I have used AWS CloudWatchLogs API with Node.js and Angular.js to develop this dashboard. Amazon docs give better documentation to implement a Node.js application with AWS SDK. You can follow this documentation to get more information about AWS.CloudWatchLogs API.

Class: AWS.CloudWatchLogs - AWS SDK for JavaScript

Development Coverage

I have developed back-end with Node.js and It can retrieve the data from AWS CloudWatchlogs using REST APIs. There are several APIs which can play a major role in this development.

  1. Cloudwatchlogs.describeLogGroups() — Used to retrieve Log groups from AWS CloudWatchLogs.
    Log groups — groups of log streams that share the same retention, monitoring, and access control settings. Each log stream has to belong to one log group (source).
    Limits : You will get only 50 log groups per a request with nextToken. So you can get next set of log groups using that nextToken.
  2. cloudwatchlogs.describeLogStreams() — Used to retrieve Log Streams under given Log Group from AWS CloudWatchLogs.
    Log streams — A log stream is a sequence of log events that share the same source. More specifically, a log stream is generally intended to represent the sequence of events coming from the application instance or resource being monitored (source).
    Limits : You will get only 50 log streams per a request with nextToken. So you can get next set of log streams using that nextToken.
  3. cloudwatchlogs.filterLogEvents() — Used to retrieve Log Events under given Log Group and set of Log Streams (max 100) from AWS CloudWatchLogs.
    Log Events — A log event is a record of some activity recorded by the application or resource being monitored. The log event record that CloudWatch Logs understands contains two properties: the timestamp of when the event occurred, and the raw event message (source).
    Limits : You will get only 10000 log events per a request with nextToken. So you can get next set of log events using that nextToken. You can give only 100 log streams per request as an array.

I have implemented all the REST calls for the necessary actions using Node.js(Express framework) and Stared the server.

Now I can get the Logs from AWS CloudWatchlogs to my client PC — As JSON Objects …!
JSON Object for the Log Events request

Now, I wanted to display those JSON Objects to the User, So I advised to implement using Jaggery, But for the demonstration part, I have started to build using Angular — because I already familiarized with Angular.

Dashboard Log Groups page
You can check my Repo to get more about the code :D

suthagar23/aws-cloudwatchlogs-dashboard

WSO2 Integration Cloud

One of the cloud service under WSO2 is Integration Cloud. WSo2 just implemented their Integration product in Cloud to make it easy for their customers.

You can just go to http://wso2.com/cloud/ to access WSO2 Cloud and you will be given 14 days trial period at the beginning. But unfortunately, If you have a trial license, then your deployed application will be turned off after 8 hours from that application’s deployed time.

You can just Sign up using your Email, No more requirements :-)

After the successful login/signup, you will be redirected to WSO2 Cloud Dashboard.

Cloud Dashboard of WSO2 Cloud

Just Click on Go under WSO2 Integration Cloud and then, you will be automatically redirected to WSO2 Integration Cloud dashboard. WSO2 provides great UI/UX for their customers with reduced complexity. You can see, there are only a few functionalities(buttons) are available for the customers!

Just Click on Create New Application. Then you can see there is some support applications list.

Currently, they are providing Integration Support for,

  1. WSO2 ESP Composite Application — Allows you to deploy an ESB configuration that is supported by WSO2 Enterprise Service Bus
  2. Ballerina — Allows you to deploy an integration scenario developed by Ballerina.

And they are providing Service support for,

  1. Java Web Application — Allows you to create dynamic websites using Servlets and JSPs and deploy web services.
  2. Java Micro Service — Allows you to create dynamic websites using Servlets and JSPs and deploy web services.
  3. PHP Web Application —Allows you to create dynamic websites using Servlets and JSPs and deploy web services.
  4. WSO2 Jaggery Application — Allows you to write all parts of web applications, services, and APIs in a completely JavaScript way.
  5. WSO2 Data Service —Allows you to deploy a data service that is supported in WSO2 Data Services Server.
  6. Node.js Application —A llows you to deploy a data service that is supported in WSO2 Data Services Server.

Deploy Amazon CloudWatchLogs Application into Integration Cloud

Just create Node.js Application to deploy this Amazon CloudWatchLogs Application.

One Minute! You want to include your Node.js route file/initial file as Index.js. Because when Integration cloud tries to start your application, It will try to start from Index.js.

When you moved to create New Node.js application, you will be required to Upload Zipped file or provide URL for the application.

Are You new to WSO2 Integration Cloud, then just click on Try out Samples ….

Then after, you will be required to provide relevant information such as Application Name, Version and Description for your deployment. Finally, WSO2 Integration cloud will create Docker images for your application and start to build your application in Cloud.

What is Docker? Just follow my blog post about the Dockers !

After the creating the application, You will be redirected to the application Dashboard which will give more information about your deployment. There will be an auto generated URL for your Node Application and you can just click on that to start your Application.

Cool… Now Amazon CloudWatchLogs Application is running on WSO2 Integration Cloud …!
Referred Source -
  1. http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudWatchLogs.html
  2. http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogsConcepts.html

by Suthagar Kailayapathy at July 10, 2017 08:30 AM

Jude Niroshan

[GSoC-2017: 6th week] Built-In Reports for Reference Application OpenMRS

This week I was trying to fetch the report data to the OWA through Reporting REST API. I was actually kind of stuck there as I couldn’t get the results which was supposed to be returned from the API. Last week we couldn’t have the weekly meeting with my mentor as he had some unexpected things situations. But he never forgot to send a message why he is late for the meeting.

He was so willing even to ask for a another time slot to continue this week meeting. So, we have met again on Saturday (08-July). At that day, both my mentors were present, I was so happy to see my backup mentors was also in our call. So, I explained them what I was stuck and we dig into the problem.

We debug the server and found out that some of my earlier development had a problem. Actually the exception was a NullPointerException. The reason when I request for a report through reporting REST, the defined definition library for some of the reports had actually returning null. Once I fixed that, I was able to see the results coming through the Reporting REST. I was so much happy that at the end of almost one an half weeks of struggling, I could get through that issue.

I’m still in the process of creating separate React components for each of those reports. Hope to finish that within few days. Tomorrow I have my weekly meeting. So, stay in touch for more info about my GSoC’17 experience :-)

by Jude Niroshan at July 10, 2017 08:24 AM

July 09, 2017

Kwateng Ofori

Sixth week of GSoC @ OpenMRS

Finally this week I’m able to fix all code incompatibility issues during STU3 migration and compile the module. It required lot of effort to understand the API changes and change the code. My mentor advised me to fully test all the features after the migration as it was subject to major changes. Now I’m going to do that during next week.

by Ofori Kwateng at July 09, 2017 08:03 PM

Sanatt Abrol

Week 6 Client Registration API fixed

Week 6 : Client Registration fixed

After finishing migration last week, the next hurdle was to fix client registration API. The problem in the previous API was that client credentials were not properly generated and persisted in the database. After checking the local MySQL deployment, I found out that client_identifier and client_secret were both NULL. The problem was that after generation of credentials, the new state of the Client object was not saved.

So, I ran a few tests and realised the problem. Calling the method saveOrUpdate(client) again after credential generation and persistence solved the error.

Next Work : This week’s work means that now we have a migrated module with API fixed. The work in the coming week involves testing the functionality of the module, introducing the REST based Client Registration and updation mechanism made earlier, uploading everything to OpenMRS official GitHub and adding documentation of the module.

The post Week 6 Client Registration API fixed appeared first on Sanatt Abrol.

by sanattabrol at July 09, 2017 06:06 AM

July 08, 2017

Choxmi Sathsara

GSoC @OpenMRS 6th week

Last week I was struggling with the database issue I mentioned in last update. I was able to regain access to the database after resetting the database. After fixing the database, I started working on saving mapped report details to the database.

In this week, I was able to complete he main functionalities of my project and created a pull request for that. With the changes I did to the module, now it is possible to map any indicator of a particular Reporting module report with DHIS report data element. Mapped reports are displayed in the combo box. Currently I am waiting for the comments and feedback from my mentors. After their feedback, I’m planing to improve the solution.

In addition to the main task of my project, I worked on two tickets during this week. Both of them were regarding the DHISReport reporting module. Ticket DRM-28 was about Orgunit null pointer exception and this is the PR. Ticket DRM-9 was about handling missing parameter exception and this is the PR.

Next week I am planing to do the improvements to the project after the review of my mentors. Currently I am waiting for their feedback. That’s all for this week. :)

by Choxmi Sathsara at July 08, 2017 07:17 AM

July 07, 2017

Suthagar Kailayapathy

Getting Started with AWS JavaScript SDK

Build JavaScript App with Amazon Web Services

I just joined with WSO2 as an Intern for Cloud Team. After the first chat with my mentor, I was assigned to the Project about Amazon Cloud Watch Logs. Before working on that project, I prepared with AWS Javascript SDK. I have shared some useful information or the beginners here!

AWS provides JavaScript SDK for Node.js or Browsers which can allow to interact with Amazon Web services through Java Script developments. The JavaScript APIs which are available in the SDK allows developers to build libraries or applications that make use of AWS services.

Using the AWS SDK for Node.js developments

Node.js is the one of the major cross-platform run-time for running server-side JavaScript applications. So here you need to configure your environment for Node.js before working with AWS SDK. You can follow this tutorial to install Node.js for your environment.

How To Install Node.js on Ubuntu 16.04 | DigitalOcean

Now we are moving to create first JavaScript App which can interact with AWS!

First Development

  • There is a sample project in the GitHub, So you can simply clone to your system. You must have Git installed to get this project from GitHub.

suthagar23/aws-nodejs-sample

If you clone the project, then You can see these followings line in the sample.js file.

// Load the SDK and UUID
var AWS = require(‘aws-sdk’);
var uuid = require(‘node-uuid’);
  • It means, the JS files requires those dependencies for the development. So you need to run npm installcommand to install those required dependencies including AWS SDK.
  • Now you want to configure your environment with AWS. To configure the AWS credentials, Create a credentials file at ~/.aws/credentialson Mac/Linux or C:\Users\USERNAME\.aws\credentials on Windows
In Linux, You want to go to your Home directory and press Ctrl+H to get the view of hidden folders. Then after create a directory as .aws and then create a credentials file inside the folder.

Create credentials file using this following lines,

[default]
aws_access_key_id = your_access_key
aws_secret_access_key = your_secret_key

How to get AWS Access Key and Secret Key?

If you haven’t Amazon Access Key and Secret Key already, then follow these ways to get it,

  • Go to your AWA Console and then Search Identity and Access Management under Services and Click to enter IAM. In the IAM Dashboard, you can see this following menus,
  • Click on the first menu(Delete your root access keys) and then click Manage Security Credentials to get your keys.
  • Then after you will be redirected to Security Credentials management dashboard. At there, Click access Keys(Access Key ID and Secret Access Key menu). Now you can see Create New Access Key button.
  • Click Create New Access Key button to get your Access Keys. If you click Show Access key there, then you will get your Access Key and Secret Access Keys.

Run your First Application

Now you are almost ready to run your first JavaScript application with AWS. So just type node sample.js command to execute the code file. If you configured and manged all the dependencies correctly, then most properly you will get a success message like this,

Finally, If you check your Amazon S3 account, then you can see there was a new bucket created and the hello_world.txt file was uploaded inside that bucket.

What happened? You just uploaded hello_world.txt file from your client machine to Amazon S3 cloud :-)
Image http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/s3-examples.html

Help from

  1. http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-started-nodejs.html
  2. http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/installing-jssdk.html

by Suthagar Kailayapathy at July 07, 2017 08:58 AM

July 03, 2017

Reuben Varghese

WEEK -5 Updates [30th June — 7th July]

This week was all about somehow completing AO 4. Thankfully, I have completed it and also created a PR for the same. This week was also amazing because I passed the first evaluation with my mentor being happy with me and me receiving my first proper stipend!

I will describe my work in more detail a few days later :)

For now, on to week 6!

by Reuben Varghese at July 03, 2017 11:51 PM

Jai Tatia

WEEK 5 [28th June – 04th July]

The best part of this week, was to know that i had managed to pass the 1st evaluations. 1/3rd period of the time allotted was over, and i am glad that i have been able to adhere to the timeline. A lot of changes have been made to the original time-line. Adding Rest resources to expose the module and working on Angular directives, was something that was planned on later, since we felt that an AngularJs directive would be more useful than a UI fragment. There was just one teeny tiny problem , I had no experience with AngularJs.
This however made the project even more interesting. I for one love the learning curves involved in projects, and the challenges that come with it. With this in mind, I invested my time in understanding AngularJs with focus on directives.

What we aim on achieving is to have an angular directive that one can include on a form for an OpenmrsObject that allows a user to view/add/remove tags. They would take in the following arguments:

viewOnly (boolean): Specifies if the user can only view or can view and also add/remove tags
objectUuid (String): The uuid of the OpenmrsObject
objectType (String): The fully qualified java class name of the domain object

Some good sources for AngularJs:-
https://docs.angularjs.org/tutorial ( for basics)
https://docs.angularjs.org/guide (developers guide)


by jtatia at July 03, 2017 06:30 PM

Kwateng Ofori

Fifth week of GSoC @ OpenMRS

This week, I entirely worked on migrating the resources to STU3 compatible resources. It’s a very very complicated task as STU3 is subjected to several major changes when comparing to STU3. After the discussion with mentor, I created several JIRA tickets for the changes. My current changes can be seen at [1]. Created below JIRA tickets. There are several changes yet to be done.

[1] https://github.com/openmrs/openmrs-module-fhir/pull/132

by Ofori Kwateng at July 03, 2017 06:18 PM

Chanuka Wijayakoon

GSoC 2017 – Week 5

Another week passes and we’re done with the first round of development. In this round we worked to migrate the Operation Theater module to the current platform, and the last week focused on modifying the theater scheduler. We’ve finished modifying it, and the results are mind-boggling. No, seriously, it’s messed up. Right now it schedules …

by merovingienne at July 03, 2017 06:12 PM

Suthagar Kailayapathy

First Evaluation — Google Summer of Code

Week 5 [June 26, 2017 — July 03, 2017]

This is my first evaluation week for the Google Summer of Code program. The evaluation means My mentor and I want to complete a survey to pass the evaluation. The evaluation period staretd was active during June 26 — June 30, 2017.

The survey asks some questions about myself, Work done and feedback for the Organization and GSoC Program like these following,

First Evaluation Questions

  • Is this your first year with your organization?
  • If you’ve participated in GSoC before, which organizations did you work with?
  • Did you contribute to this organization before GSoC?
  • Is your project a continuation of a previous year’s project?
  • When did you first communicate with your organization this year?
  • How often do you interact with your mentor(s)?
  • How do you communicate with your mentor(s)?
  • Rate the quality of interactions with your mentor(s)
  • How responsive are your mentor(s)?
  • What is your favorite part of participating in GSoC?
  • What is the most challenging part of participating in GSoC?
  • Feedback for your organization and mentors
  • Anything else you’d like to tell Google?

After the evaluation period, I received a mail about the Evaluation results. I have passed successfully :-) .
Yah , Now time to receive the stipend from Google through Payoneer.

Student Stipends

Stipends are paid in three parts, one after each successful evaluation.

  • First Evaluation (paid early July): 30%
  • Second Evaluation (paid early August): 30%
  • Final Evaluation (paid mid September): 40%

Stipend amounts are calculated based on my location. According to my PPP, I am going to receive 720 USD at this time. (for Sri Lanka)

Development Coverage

I have advised to upload my OWA to https://modules-refapp.openmrs.org/openmrs/ for the mentor’s view. So I need to finalize the Module for the mentor’s view. I want to complete this following parts immediately at that time,

  • Implemented OpenMRS Header for OWA
  • Implemented OpenMRS Breadcrumbs for OWA
  • Modified buttons with OpenMRS UI Icons
  • Implemented Check Updates for Module feature.

Finally, I have uploaded my OWA to online reference application and received some feedback from my mentor. He advised me to start work on Encounters after some alterations on existing OWA module. So Currently I am working on existing OWA to complete the pending works.

by Suthagar Kailayapathy at July 03, 2017 05:55 PM

Shivang Nagaria

FontAwesome, Datatables and OpenMRS

GSoC’17@OpenMRS — Week Five

Hello Everyone,

This week I worked on issue DINT-76 in which I have to add capability to export a particular list.

I guess you’ve remembered previous posts in which I mentioned a list which generated by running a particular set of rule which check for data violations. In DINT-73, I worked on improving filtering of the list. In that issue, I have used filters provided by datatables library.

DINT-76 was also related issue. I need to add feature which enables users to export the filtered list in different formats which includes Excel, PDF and CSV. Due to plugins available in the datatables, I was able to implement it very quickly and it worked nicely.

Current UI — you can see export option on top left

One more things I need to take care of is that the UI shouldn’t very cluttered due to new features available to user. For time being — I kept it like shown in the above image. Later my mentor suggested — it would be nice to add small buttons with respective icons indication excel, pdf and csv.

I looked up on the internet and landed to fontawesome.io . It makes it very easy to add new icons — but that’s not my case. I need to find a way to integrate particular icons in the OpenMRS. I asked around and dig on community pages and found the OpenMRS is already using FontAwesome Library but it is only importing specific icons. So the whole thing boiled down to adding a bunch of new icons in the OpenMRS icon set apart from datatable thing. It the things I’m currently working on. I hope I will get it done with soon.

Thanks for reading!

Useful Links:

by Shivang Nagaria at July 03, 2017 04:44 PM

Xu Hao

Open Concept Lab enhancements — The 5th Week of GSoC 2017

I am glad that I have passed the first evaluation, I got the approval from most people, especially the mentor and organization. I feel happy that I implement the first task and mentor Jon gave me some suggestions about specific implementation proposal for certain task. I can be better when I correct my shortcomings.

This month’s task is more challenging for me because I have not did something about front end development. I have not used JavaScript and library about it. And our project is developed by AngularJS. So this week I learn something basics about AngularJS. I have to say, front end is hard to me. But I am glad that I can get something about JS, because as a developer, we should own more technologies and broad view.

So I list something I learned this week and I prepare to learn it with two weeks, then I will write the implementation proposal about the second task. I have seen

  • Expressions
  • Modules
  • Scope
  • Controller
  • Filter
  • Directives

So I will learn the rest of the knowledge in next week. This two weeks are absorbing weeks. That’s all. Thank you.

by Xu Hao at July 03, 2017 02:15 PM

Ayush Goyal

GSoC — Week 5

This week I worked on adding charts to the patient dashboard of the android client.

Various vitals of a patient like respiration rate, pulse, body temperature etc are recorded during a visit. Currently, all the past data was displayed as a simple list to the user. A better representation was to use graphs so that proper variation in the patient’s vitals data can be easily visualised.

I intended to use William Charts[1] as the graph library but later on found that the documentation was not proper and then I did little more digging and found MPAndroidChart[2]. It is far better than William Chart because the graphs were more responsive and more features are included in it. Also the documentation was more user friendly so I used MPAndroidChart as the graph library and added graphs for the patients vitals.

Below are some of the screenshots after addition of the Graphs.

Patient dashboard home screen
Charts tab
Sample Chart

The main challenge I faced while working on the graphs was putting dates on the x-axis. The problem was that the entry object of the chart took only floats as input for x and y co-ordinates. So, I created a custom value formatter[3] and sent my date value array list of strings to the formatter and set x co-ordinate as the index in the adapter and then mapped them in the formatter.

Also, the devtest04 server was down and the JSON forms were not added on the qa-refapp server so I made a dummy patient on the qa-refapp.openmrs.org server and then downloaded the patient on the android client for testing.

According the discussion on the Openmrs talk thread[4] and issue no. AC-423[5], it was decided that the form should not be created on the manually on the server, rather it should be auto-created by the Android Client if missing. So, I also started working on it.

References :

[1] https://github.com/diogobernardino/WilliamChart

[2] https://github.com/PhilJay/MPAndroidChart/

[3] https://github.com/DefCon-007/openmrs-contrib-android-client/blob/fe58964b0ba48ad749d8ac8eca22dbae9ce642ec/openmrs-client/src/main/java/org/openmrs/mobile/utilities/DayAxisValueFormatter.java

[4] https://talk.openmrs.org/t/dynamic-form-ui-generation-from-json-schema/6707

[5]https://issues.openmrs.org/browse/AC-423?jql=project%20%3D%20AC

by Ayush Goyal at July 03, 2017 09:36 AM

Choxmi Sathsara

GSoC @OpenMRS 5th week

Last week I was able to add report definitions to the combo box and developed a triggering function for mapping buttons. In this week, I worked on connecting mapping results to the controller and modifying the dhisreport_datavalue_template table.

Instead of using the button for mapping, I added an anchor tag and connected the results to the MapReportsController. After successfully mapping the jsp with the controller, I defined two alternative columns to the dhisreport_datavalue_template table. Adding those columns was successful.

After modifying the database, I tried to modify the DataValueTemplate model class as the next step. But, still I couldn’t edit that class. Because of the issue I faced after modifying that class, my local instance got crashed. :(

Currently, I am working on restoring my instance. After that, I am planning to store the mapping data to the table within next two weeks.

That’s all for this week… :)

by Choxmi Sathsara at July 03, 2017 06:57 AM

Jude Niroshan

[GSoC-2017: 5th week] Built-In Reports for Reference Application OpenMRS

It’s soon after my 1st evaluation. I’m excited. I even received 30% of my stipend amount thanks to Google. This week actually I started to work on OWA. That’s another reason for me to excite as I could now learn about ReactJS view library which has developed by Facebook. first 2 days of this week I did some remaining work from previous week, which was to write unit tests. I completed it and made a PR to reference Metadata module.

I created a new repository for OWA and hosted it in my github account. This was communicated with my Mentor and he will be able to make reviews in there.

I thought to make a separate branch for each week of my work so that it will be clear enough to review my work. OpenMRS follows a standard naming convention for OWA naming. I followed, but sometimes my mentor would have a better name than what I thought of.

Currently I’m working on fetching a simple report data to my OWA via the Reporting REST API.

by Jude Niroshan at July 03, 2017 04:23 AM

July 02, 2017

Sanatt Abrol

Week 5 – Migration Complete! API fixed

This was a pretty good week. I was able to complete the migration of the existing code to OpenMRS 2.x using Spring 4.1.4.RELEASE and Spring security 4.0.4.RELEASE.

The next step was fixing the API so that I can register clients and manage them. The aim was to fix the API and include the REST Client made before. The problem in the API was of the duplicate hibernate mapping. The Client class in the OAuth Module inherited the BaseOpenMRSData and overriding a few methods would mean re declaration of their instances which would cause duplicate hibernate mapping errors. I removed all the duplicate entries from the class.

Next problem? The tests won’t pass.

The test data didn’t specify UUID column and that was a must. UUID can not be kept null or undeclared. I added unique UUID values and that passed the tests.

The module ran successfull registration for the first time in a month and I was able to reach token endpoints as well.

New problem? Generation of client credentials. Client credentials were generated and encrypted for better security by the module. However, this generation and encryption failed on the Migrated module due to change in Java version. The next step involves fixing this client credentials generation issue.

The post Week 5 – Migration Complete! API fixed appeared first on Sanatt Abrol.

by sanattabrol at July 02, 2017 07:38 PM

Ankit Kumar

Evaluation Week ( 2nd part of work period )

After completion of the 4th week of the coding period, it was the time of my first evaluation. My mentor (Pascal Brandt) gave me the green signal to continue further in this project as a part of GSoC 2017.
This week I worked on improving some of the previously introduced components and also on designing the new patient search component. The patient search component is almost completed this week. I also got the support from my mentor in debugging some of the part of this component's code. My codes were reviewed this week by my mentor and also got some comments on it.

I keep my work on this repository : https://github.com/Ankitkumar94/owa-testApp

I am now providing a gist of the components I have introduced in the openmrs-owa-generator.
This is what my patient search component looks like :




Still more work to be done on this patient search component !!

Other than that, I have used the openmrs-contrib-uicommons library to introduce some of the

components. So, basically we already have :

breadcrumbs component :





notification component :



which shows a toast like this :




translate component :




which translates a specific text in the language specified (as above) !!

Now, I will be working on some improvement of the patient search component and designing some

more components as decided here on the talk :  https://talk.openmrs.org/t/new-angularjs-components-for-openmrs/12146

Further, I will start writing the unit tests for the components after all the above things

(mentioned above) !!

Thanks,

Ankit kumar


by Ankit Kumar (noreply@blogger.com) at July 02, 2017 04:00 PM

July 01, 2017

Nipun Thathsara

Approach

If you take a look at the objective of the project, it is to move the Unknown patient registration functionality to the core of Openmrs. But as in previous post, the patient saving process is the same for a normal patient as for an unknown.

Steps: 
  • Identifying what differences are made in the process when patient is an unknown.
    In RegistrationApp following configurations are made if the patient is  marked unknown.
    1
    2
    3
    4
    5
    6
    if (unknown != null && unknown) {
    // TODO make "UNKNOWN" be configurable
    name.setFamilyName("UNKNOWN");
    name.setGivenName("UNKNOWN");
    patient.addAttribute(new PersonAttribute(emrApiProperties.getUnknownPatientPersonAttributeType(), "true"));
    }
    These are the only changes that are specific to an unknown patient in the current implementation. Other steps are common for both identified and unknown. 
  • In order to move the unknown patient registration functionality to the core, these configurations should be done in the core.
  • These should be configured inside the savePatient method of core.
     1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    @Override
    public Patient savePatient(Patient patient) throws APIException {
    requireAppropriatePatientModificationPrivilege(patient);

    if (!patient.getVoided() && patient.getIdentifiers().size() == 1) {
    patient.getPatientIdentifier().setPreferred(true);
    }

    if (!patient.getVoided()) {
    checkPatientIdentifiers(patient);
    }

    setPreferredPatientIdentifier(patient);
    setPreferredPatientName(patient);
    setPreferredPatientAddress(patient);

    return dao.savePatient(patient);
    }

  • Unknown attribute should be passed along with the patient object, and over writing name and etc should be done in core.
  • I am planning to get the mentor's idea on this and implement the solution.

by Nipun Thathsara (noreply@blogger.com) at July 01, 2017 09:17 PM

Lahiru Jayathilake

Week 5: Important Work

In this week I have been working on PTM-84. As I mentioned in OpenMRS talks the current version does not support to match patients by taking two datasources. That means it only supported to match patients by deduplication. 

What is required to do?
According to my ultimate goal Patient Matching 2.0 module must support for the incremental patient matching. For that it is required to,
  • Fetch patients considering the date created or date changed with the report date
  • Fetch all the patients (except the patients that have been already fetched)
and perform the match with two data sources.

Why this is necessary?
The current version is not an efficient method for implementations having huge set of records.

For instance, if we have 10,000 patients in our system and we need to match the patients using first name and the date of birth. Goal is to check for the duplicates among them. If we compare all patients to all the others that is roughly 50 million comparisons ( 10,000 x (10,000 - 1) / 2 ). After couple of days if we run the same match where 90 patients have been added and 10 updated, with the current version it would still carry out the same method of comparison and this time it would be about 51 million comparisons!
The current goal is to perform comparisons only for the added and updated records for that particular match. If we have this sort of an amazing method rather than 51 million of comparisons it would result in only about 1 million [(100 x 99 / 2) + (100 x 9990)]. 

In order to do that we should consider two datasources without that it is just matching updated or added patients with themselves. (deduplication)

What I have done ?
These are the things I did, I had to change couple of methods in MatchingReportUtils.java
The methods are
  1. InitScratchTable
  2. CreRanSamAnalyzer
  3. CreAnalFormPairs
  4. CrePairdataSourAnalyzer
  5. ScoringData
  6. CreatingReport
In order to support for two datasources rather than deduplication.

by Lahiru Jayathilake (noreply@blogger.com) at July 01, 2017 04:10 PM

Jude Niroshan

GSoC-2017 First Evaluation Passed!!!

Tadaaa… I was able to make through the first evaluation of Google Summer of Code 2017. I was regularly working with my project and communicated with my mentor and others who are in the community. I am always excited to see congratulations emails from GSoC. :D

My mentor Rafal at OpenMRS is really helpful and very calm person. He is ver supportive. Without him, it would be really difficult for me to get through some of the tough times I had. So, big thanks goes out to my loyal mentor as well. :)

by Jude Niroshan at July 01, 2017 02:45 AM

June 27, 2017

Nipun Thathsara

Current implementation - Backend

Previous post was about the current implementation of the front end design of current implementation. This post will mention the path to the database through the backend. Walking through i have identified that this involves two modules and the core itself.

1. RegistrationApp  module
2. RegistrationCore module
3. Openmrs Core

request from the browser is:
URL:http://localhost:8080/openmrs/registrationapp/registerPatient/submit.action?appId=referenceapplication.registrationapp.registerPatient&&preferred=true&gender=F&unknown=true

Step 1:
Registration App module - RegisterPatientFragmentController.java submit method of this controller is used to capture submit event.


 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public FragmentActionResult submit(UiSessionContext sessionContext, @RequestParam(value="appId") AppDescriptor app,
@SpringBean("registrationCoreService") RegistrationCoreService registrationService,
@ModelAttribute("patient") @BindParams Patient patient,
@ModelAttribute("personName") @BindParams PersonName name,
@ModelAttribute("personAddress") @BindParams PersonAddress address,
@RequestParam(value="birthdateYears", required = false) Integer birthdateYears,
@RequestParam(value="birthdateMonths", required = false) Integer birthdateMonths,
@RequestParam(value="registrationDate", required = false) Date registrationDate,
@RequestParam(value="unknown", required = false) Boolean unknown,
@RequestParam(value="patientIdentifier", required = false) String patientIdentifier,
HttpServletRequest request,
@SpringBean("messageSourceService") MessageSourceService messageSourceService,
@SpringBean("encounterService") EncounterService encounterService,
@SpringBean("obsService") ObsService obsService,
@SpringBean("conceptService") ConceptService conceptService,
@SpringBean("emrApiProperties") EmrApiProperties emrApiProperties,
@SpringBean("patientValidator") PatientValidator patientValidator, UiUtils ui) throws Exception {


NavigableFormStructure formStructure = RegisterPatientFormBuilder.buildFormStructure(app);

if (unknown != null && unknown) {
// TODO make "UNKNOWN" be configurable
name.setFamilyName("UNKNOWN");
name.setGivenName("UNKNOWN");
patient.addAttribute(new PersonAttribute(emrApiProperties.getUnknownPatientPersonAttributeType(), "true"));
}


this method captures any patient submit and checks if Unknown. If so sets attributes appropriately. Then the service is called.

Step 2:
RegistrationCore module - RegistrationCoreServiceImple.java this service is then called.





 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@Override
public Patient registerPatient(Patient patient, List<Relationship> relationships, String identifierString, Location identifierLocation) {
if (log.isInfoEnabled())
log.info("Registering new patient..");
if (patient == null)
throw new APIException("Patient cannot be null");

IdentifierSourceService iss = Context.getService(IdentifierSourceService.class);
if (idSource == null) {
String idSourceId = adminService.getGlobalProperty(RegistrationCoreConstants.GP_OPENMRS_IDENTIFIER_SOURCE_ID);
if (StringUtils.isBlank(idSourceId))
throw new APIException("Please set the id of the identifier source to use to generate patient identifiers");

try {
idSource = iss.getIdentifierSource(Integer.valueOf(idSourceId));
if (idSource == null)
throw new APIException("cannot find identifier source with id:" + idSourceId);
}
catch (NumberFormatException e) {
throw new APIException("Identifier source id should be a number");
}
}

At the end this method calls the platform services.


1
patient = patientService.savePatient(patient);

Step 3:
Openmrs core module - PatientServiceImpl.java savePatient method of this class is called upon saving. therefore, the path is through the platform itself.

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
@Override
public Patient savePatient(Patient patient) throws APIException {
requireAppropriatePatientModificationPrivilege(patient);

if (!patient.getVoided() && patient.getIdentifiers().size() == 1) {
patient.getPatientIdentifier().setPreferred(true);
}

if (!patient.getVoided()) {
checkPatientIdentifiers(patient);
}

setPreferredPatientIdentifier(patient);
setPreferredPatientName(patient);
setPreferredPatientAddress(patient);

return dao.savePatient(patient);
}

As line 18, it calls the DAO layer now.
And then to the Hibernate PatientDAO and saves to the database.

If the data is routed through the platform already, then what's the difference in case of an unknown patient? that's to be solved.





by Nipun Thathsara (noreply@blogger.com) at June 27, 2017 12:07 PM