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

ATLAS-206: Added basic reporting resource to API #112

Merged
merged 1 commit into from Aug 18, 2019

Conversation

@HelioStrike
Copy link
Collaborator

commented Aug 6, 2019

JIRA issue: https://issues.openmrs.org/browse/ATLAS-206

GET /api/report/foo returns something like :

{
    "module": "foo",
    "versions": {
      "1.0.0": 7,
      "1.2": 5,
      "2.0": 17
    }
}

Would be perhaps want a GET to return details of all modules being used?

@HelioStrike HelioStrike requested a review from bmamlin Aug 6, 2019

@HelioStrike HelioStrike force-pushed the HelioStrike:ATLAS-206 branch from 8217e44 to 26695b0 Aug 8, 2019

@HelioStrike

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 8, 2019

@bmamlin I changed the API response a little so that the "GET all modules' data" and "GET 1 module's data" would match. Here are a few samples (and a JSON formatter to come in handy).

GET /api/report :

{"Atlas Module":{"versions":{"2.3-SNAPSHOT":3}},"Form Entry App Module":{"versions":{"1.4.2":3}},"Reporting":{"versions":{"1.17.0":3}},"Metadata Sharing":{"versions":{"1.5.0":3}},"ID Generation":{"versions":{"4.5.0":3}},"Allergy UI Module":{"versions":{"1.8.1":3}},"EMR API Module":{"versions":{"1.28.0-SNAPSHOT":3}},"Registration App Module":{"versions":{"1.13.0":3}},"HTML Form Entry UI Framework Integration Module":{"versions":{"1.7.0":3}},"App Framework Module":{"versions":{"2.13.0":3}},"Reporting REST":{"versions":{"1.10.0":3}},"Reference Metadata Module":{"versions":{"2.9.0":3}},"Metadata Mapping":{"versions":{"1.3.4":3}},"Admin UI Module":{"versions":{"1.2.4":3}},"App UI Module":{"versions":{"1.10.0-SNAPSHOT":3}},"Metadata Deploy":{"versions":{"1.11.0":3}},"Reference Application Module":{"versions":{"2.9.0":3}},"OpenMRS UI Framework":{"versions":{"3.15.0":3}},"Reporting Compatibility":{"versions":{"2.0.6":3}},"HTML Widgets":{"versions":{"1.10.0":3}},"Serialization Xstream":{"versions":{"0.2.14":3}},"Address Hierarchy":{"versions":{"2.11.0":3}},"Registration Core Module":{"versions":{"1.8.0":3}},"Attachments":{"versions":{"2.1.0":3}},"Event Module":{"versions":{"2.7.0":3}},"Core Apps Module":{"versions":{"1.23.0-SNAPSHOT":3}},"Chart Search Module":{"versions":{"2.1.0":3}},"Provider Management Module":{"versions":{"2.10.0":3}},"Calculation":{"versions":{"1.2":3}},"Appointment Scheduling UI Module":{"versions":{"1.7.0":3}},"Open Web Apps Module":{"versions":{"1.10.0":3}},"HTML Form Entry":{"versions":{"3.8.0":3}},"FHIR Module":{"versions":{"1.18.0":3}},"UI Commons Module":{"versions":{"2.6.1":3}},"Rest Web Services OMOD":{"versions":{"2.24.0.573609":3}},"Reporting UI Module":{"versions":{"1.6.0":3}},"Appointment Scheduling Module":{"versions":{"1.10.0":3}},"Legacy UI Module":{"versions":{"1.5.0":3}},"Data Exchange Module":{"versions":{"1.3.3":3}},"UI Library Module":{"versions":{"2.0.6":3}},"Reference Demo Data Module":{"versions":{"1.4.4":3}}}

GET /api/report/Atlas Module :

{"Atlas Module":{"versions":{"2.3-SNAPSHOT":3}}}

What do you think?

@HelioStrike HelioStrike force-pushed the HelioStrike:ATLAS-206 branch 2 times, most recently from d8237d7 to 4bc8ffe Aug 9, 2019

@HelioStrike

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 9, 2019

@bmamlin Updated the PR :)

JSON formatter

GET /api/report :

[{"id":"atlas module","name":"Atlas Module","versions":{"2.3-SNAPSHOT":1}},{"id":"form entry app module","name":"Form Entry App Module","versions":{"1.4.2":3}},{"id":"reporting","name":"Reporting","versions":{"1.17.0":3}},{"id":"metadata sharing","name":"Metadata Sharing","versions":{"1.5.0":3}},{"id":"id generation","name":"ID Generation","versions":{"4.5.0":3}},{"id":"allergy ui module","name":"Allergy UI Module","versions":{"1.8.1":3}},{"id":"emr api module","name":"EMR API Module","versions":{"1.28.0-SNAPSHOT":3}},{"id":"registration app module","name":"Registration App Module","versions":{"1.13.0":3}},{"id":"html form entry ui framework integration module","name":"HTML Form Entry UI Framework Integration Module","versions":{"1.7.0":3}},{"id":"app framework module","name":"App Framework Module","versions":{"2.13.0":3}},{"id":"reporting rest","name":"Reporting REST","versions":{"1.10.0":3}},{"id":"reference metadata module","name":"Reference Metadata Module","versions":{"2.9.0":3}},{"id":"metadata mapping","name":"Metadata Mapping","versions":{"1.3.4":3}},{"id":"admin ui module","name":"Admin UI Module","versions":{"1.2.4":3}},{"id":"app ui module","name":"App UI Module","versions":{"1.10.0-SNAPSHOT":3}},{"id":"metadata deploy","name":"Metadata Deploy","versions":{"1.11.0":3}},{"id":"reference application module","name":"Reference Application Module","versions":{"2.9.0":3}},{"id":"openmrs ui framework","name":"OpenMRS UI Framework","versions":{"3.15.0":3}},{"id":"reporting compatibility","name":"Reporting Compatibility","versions":{"2.0.6":3}},{"id":"html widgets","name":"HTML Widgets","versions":{"1.10.0":3}},{"id":"serialization xstream","name":"Serialization Xstream","versions":{"0.2.14":3}},{"id":"address hierarchy","name":"Address Hierarchy","versions":{"2.11.0":3}},{"id":"registration core module","name":"Registration Core Module","versions":{"1.8.0":3}},{"id":"attachments","name":"Attachments","versions":{"2.1.0":3}},{"id":"event module","name":"Event Module","versions":{"2.7.0":3}},{"id":"core apps module","name":"Core Apps Module","versions":{"1.23.0-SNAPSHOT":3}},{"id":"chart search module","name":"Chart Search Module","versions":{"2.1.0":3}},{"id":"provider management module","name":"Provider Management Module","versions":{"2.10.0":3}},{"id":"calculation","name":"Calculation","versions":{"1.2":3}},{"id":"appointment scheduling ui module","name":"Appointment Scheduling UI Module","versions":{"1.7.0":3}},{"id":"open web apps module","name":"Open Web Apps Module","versions":{"1.10.0":3}},{"id":"html form entry","name":"HTML Form Entry","versions":{"3.8.0":3}},{"id":"fhir module","name":"FHIR Module","versions":{"1.18.0":3}},{"id":"ui commons module","name":"UI Commons Module","versions":{"2.6.1":3}},{"id":"rest web services omod","name":"Rest Web Services OMOD","versions":{"2.24.0.573609":3}},{"id":"reporting ui module","name":"Reporting UI Module","versions":{"1.6.0":3}},{"id":"appointment scheduling module","name":"Appointment Scheduling Module","versions":{"1.10.0":3}},{"id":"legacy ui module","name":"Legacy UI Module","versions":{"1.5.0":3}},{"id":"data exchange module","name":"Data Exchange Module","versions":{"1.3.3":3}},{"id":"ui library module","name":"UI Library Module","versions":{"2.0.6":3}},{"id":"reference demo data module","name":"Reference Demo Data Module","versions":{"1.4.4":3}},{"id":"atlas module","name":"Atlas Module","versions":{"2.3-SNAPSHOT":2}}]

GET /api/report/Atlas%20Module :

{"id":"atlas module","name":"Atlas Module","versions":{"2.3-SNAPSHOT":3}}
routes/api/report.js Outdated Show resolved Hide resolved
});
});

router.get('/report/module/:module_name', function (req, res, next) {

This comment has been minimized.

Copy link
@bmamlin

bmamlin Aug 15, 2019

Member

Use module_id instead of name. Module ids are lowercase and will not (should not) contain spaces.

routes/api/report.js Outdated Show resolved Hide resolved

@HelioStrike HelioStrike force-pushed the HelioStrike:ATLAS-206 branch from 4bc8ffe to 6d59460 Aug 15, 2019

@HelioStrike HelioStrike requested a review from bmamlin Aug 15, 2019

@HelioStrike

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 15, 2019

@bmamlin I was somehow unaware of the id key that each module has. ._.

Anyway, updated the PR. :)

@HelioStrike HelioStrike force-pushed the HelioStrike:ATLAS-206 branch from 6d59460 to 5542720 Aug 17, 2019

@HelioStrike HelioStrike force-pushed the HelioStrike:ATLAS-206 branch from 5542720 to bb18104 Aug 17, 2019

@bmamlin bmamlin merged commit 0e0bba8 into openmrs:master Aug 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.