GithubHelp home page GithubHelp logo

matches's People

Contributors

chuqyang avatar felixongati avatar hiwot-chichaybelu avatar jqueipo avatar lownin avatar maurya avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

maurya

matches's Issues

url for QR bundle upload

Please add ability to upload generated questionnaire response set to a url.

For iteration 1, let's do this as:

  • add ability for the user to specify the URL against which POST should be used;
  • once posted, mAppr should show the response received from the url (success or error);
  • following are being assumed:
    • provided url is public, and no authentication/authorization is required;
    • content-type of the POST request is application/json and receiver can handle it;
    • content (a fhir bundle of questionnaire responses in json format) is send as the body of the request.

Debug: Upload mappings from another map

On first click to upload mappings from another map, the map being populated gets the new headers,

but on the second/subsequent clicks, the matching headers get removed

fix 'split implications'

currently back end looks at path to get relevant table name e.g. knows to interact with maps table when /api/maps/map100 is called...

may want to avoid this because path could be different based on host environment. Could look into passing table name to callback (if possible) or could

front-end may generally need a configuration to know where to go to (e.g. particularly for redirects)

Probably easiest to start with is to make configuration file with the expected base path. For now, it would just be /

Build out error handling on Upload page

  • Run basic validation on file client-side (is it a file, are there headers "missing" from either CSV or extra files in the map)
  • Pass to back end if file is valid for processing
  • Conditionally handle errors returned from validation/processing
  • Handle display with management of React state (e.g hide if upload=true)

DELETE of questionnaire should delete related maps

If implementing "properly" a DELETE request on a questionnaire would remove related maps...but maybe don't want to do this as it could cause problems for users...e.g. so DELETE of questionnaire should maybe fail when there are related maps

clean up load from other Map

Need to filter out current map, and not use MaterialTable because can't get it to display within frame for this box

image

clean up file structure

clean up file structure (aka decide structure for files :-) ) and summarize for others (maybe in README)

sanitize backend

sanitize parameters on backend requests to prevent SQL injection

  1. validate table names (for now just validate against list)
  2. validate column names (maybe for now just specify valid columns for a given table)
  3. pass variables as parameters e.g. pool.query('SELECT * FROM maps WHERE uid=$1', ['abcdef'], function (err, res) { //do something })

FYI @vshioshvili

add option to add map from dashboard

add boxes for handling map add

  • retrieve/parse/pass available questionnaires
  • need to check name to make sure not in use (requires new api call)
  • handling of add through api call
  • redirect following 200 response to appropriate edit resource

generated file format should be a bundle of resources

Output of the mAppr tool needs to be a bundle type structure that has each questionnaire response as an entry.

Note that reference used for structure definition is a placeholder, and I believe we need to create one - I think it will be same for all mAppr exports, and won't vary based on the questionnaire.

Here is what it looks without any QR, followed by sample with two QR entries.

{
	"resourceType": "Bundle",
	"id": "auto-generated",
	"meta": {
		"profile": [
			"http://datim.org/fhir/StructureDefinition/PLM-QuestionnaireResponse-Bundle"
		]
	},
	"type": "message",
	"timestamp": "1970-01-01T00:00:00.001-00:00",
	"entry": []
}
{
	"resourceType": "Bundle",
	"id": "auto-generated",
	"meta": {
		"profile": [
			"http://datim.org/fhir/StructureDefinition/PLM-QuestionnaireResponse-Bundle"
		]
	},
	"type": "message",
	"timestamp": "1970-01-01T00:00:00.001-00:00",
	"entry": [
		{
			"resource": {
				"resourceType": "QuestionnaireResponse",
				"id": "R7eJnv-2019-10-11T13:09:17.752Z-row0",
				"status": "completed",
				"questionnaire": "http://datim.org/fhir/Questionnaire/PLM-FP-Questionnaire",
				"item": [
					{
						"linkId": "/Patient",
						"text": "Patient ID",
						"item": [
							{
								"linkId": "/Patient/id",
								"text": "Patient ID",
								"answer": {
								}
							},
							{
								"linkId": "/Patient/birthDate",
								"text": "Birth Date",
								"answer": {
									"valueDate": "1980-01-01"
								}
							},
							{
								"linkId": "/Patient/gender",
								"text": "Gender",
								"answer": {
									"valueCoding": {
										"system": "http://hl7.org/fhir/ValueSet/administrative-gender",
										"code": "female"
									}
								}
							}
						]
					},
					{
						"linkId": "/Encounter",
						"text": "Encounter",
						"item": [
							{
								"linkId": "/Encounter/location",
								"text": "Location ID",
								"answer": {
									"valueString": "DATIM OU UID"
								}
							}
						]
					},
					{
						"linkId": "/MedicationStatement",
						"text": "MedicationStatement",
						"item": [
							{
								"linkId": "/MedicationStatement/method",
								"text": "Family Planning Modern Method",
								"answer": [
									{
										"valueCoding": {
											"system": "http://snomed.info/sct",
											"code": "LA27903-6"
										}
									}
								]
							},
							{
								"linkId": "/MedicationStatement/startDate",
								"text": "ART Start Date",
								"answer": {
									"valueDateTime": "2010-01-01"
								}
							}
						]
					}
				]
			}
		},
		{
			"resource": {
				"resourceType": "QuestionnaireResponse",
				"id": "R7eJnv-2019-10-11T13:09:17.752Z-row1",
				"status": "completed",
				"questionnaire": "http://datim.org/fhir/Questionnaire/PLM-FP-Questionnaire",
				"item": [
					{
						"linkId": "/Patient",
						"text": "Patient ID",
						"item": [
							{
								"linkId": "/Patient/id",
								"text": "Patient ID",
								"answer": {
									"valueString": "124"
								}
							},
							{
								"linkId": "/Patient/birthDate",
								"text": "Birth Date",
								"answer": {
									"valueDate": "1981-01-01"
								}
							},
							{
								"linkId": "/Patient/gender",
								"text": "Gender",
								"answer": {
									"valueCoding": {
										"system": "http://hl7.org/fhir/ValueSet/administrative-gender",
										"code": "male"
									}
								}
							}
						]
					},
					{
						"linkId": "/Encounter",
						"text": "Encounter",
						"item": [
							{
								"linkId": "/Encounter/location",
								"text": "Location ID",
								"answer": {
									"valueString": "DATIM OU UID"
								}
							}
						]
					},
					{
						"linkId": "/MedicationStatement",
						"text": "MedicationStatement",
						"item": [
							{
								"linkId": "/MedicationStatement/method",
								"text": "Family Planning Modern Method",
								"answer": [
									{
										"valueCoding": {
											"system": "http://snomed.info/sct",
											"code": "LA27903-6"
										}
									}
								]
							},
							{
								"linkId": "/MedicationStatement/startDate",
								"text": "ART Start Date",
								"answer": {
									"valueDateTime": "2011-01-01"
								}
							}
						]
					}
				]
			}
		}
	]
}

start build of submit data page

page for submitting data

image

Tried a variety of approaches for columns (

  • Material-UI (downside is potential awkwardness with interacting between Drawer and main (also violates Material-UI design principles in that Drawer is supposed to be for navigation)
  • plain HTML/CSS divs (okay, but looks a bit inconsistent and requires a lot of syling)
  • with (also tried . There are some hassles here with Material-UI being finicky, but looks more consistent with cards on dashboard page, and layout lends itself to resizing in various window sizes

image

Allow Upload to succeed even if there are extra columns in csv file

After discussion with @vshioshvili, it was decided that we should let the CSV file be processed (with a warning) if there are extra headers in the CSV file. There will be an error if there are extra headers in the map that don't correspond to the CSV (e.g you map Gender in your map, but use Sex in your CSV file...in this case Gender being missing from CSV is an error, but Sex in the CSV file would be a warning)

Requires some backend redo because of logic in when the file should be handled

Improve error display on front-end

Make errors more readable (easiest to change how errors are returned on the back end, so that they are like {"key":{"errorType":[1,2,3]}

Fix Display of Invalid Data

• "Row" number is being duplicated.
• the number should be updated to make more sense to user (currently it returns 4 for the 6th row in the file because header row is ignored and then counting begins at 0)
• more detail should be provided on the specific value that is a problem

image

create Header Bar

create basic header bar component to be used throughout app
-mAppr name (+ placeholder for logo)
-organization name (from configuration file)
-icons for "menu" (list of maps), configuration, help

Reuse mappings

Design approach to let users use existing map as the basis for new map.

Front-end approaches are outlined here: https://whimsical.com/QopncHDGwNVsjWoh7iJi1W

Ultimately, Option 1 and Option 2 are desired, but Option 1 is priority.

This can probably run client-side, in which case "flatQuestionnaire" can be leveraged, but that may need to be revisited.

Fix bug with unassociated headers causing questionnaire to not display

When initially creating a map, it appears that if you create a header but don't associate it with a map, when you navigate away/back, the code to process the questionnaire fails because it expects there to be associations in the map between the header and the questionnaire. Need to add handling in validateMap service

image

write script to test validity/completeness of map

Need to check that everything is mapped when going to upload page before allowing actual upload

From edit screen, it would be better for performance to have the check running as changes are made, but could also be useful as a "final" check when background check alerts that map is completed

Code Review by Jakub

Hi @tomzemp,
I like the code! Looks well organized and makes sense when reading!
However, since I was asked to provide feedback I will put a few comments here :)

cc @benguaraldi

Create (expand) README

Make README

  • brief summary of project
  • instructions for setting up and running locally
  • summarize file structure (after #10)

create configuration file

create file for configuration that contains name and decide where in backend it should be

"name": "Tanzania Ministry of Health"
}```

Will need to be loaded from Main component

Can eventually contain things like language, etc,. 

Build "edit" page

Work on building page for this:
image

-Convert map properties to Chip "Headers" in side bar (with handlers for add/delete)
-In main space, have parsed questionnaire with links to map's headers/properties
-For initial stage, probably have question use a select of the available headers/properties from the map
-api calls to back-end to update map as user makes changes

Edit page - work on value mappings

From #24

Work on handling of value maps...

image

for ease of use at the moment (for proof of concept), probably want to put code system definition within questionnaires (e.g. don't go fetch from external source as we define requirements/vision for questionnaire storage)

Might be useful to prepopulate the value map with the definitions expected by the code system definition and then allow users to update

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.