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

Removed old application code, updated test README #16

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

48 changes: 28 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,55 @@
# HAPI FHIR Playground: Basic Test App
# Smile CDR Coding Test

This project is a skeleton project for querying data from the [HAPI FHIR public test server](http://hapi.fhir.org/baseR4)
This project is a skeleton project for querying data from the [Smile CDR Test Server](https://try.smilecdr.com/baseR4/Patient)

### Getting Started:

* [ ] Take a few minutes to familiarize yourself with the [FHIR Standard](http://hl7.org/fhir/) for health data exchange. In particular you might want to read the [Executive Summary](http://hl7.org/fhir/summary.html) and the [Developer Introduction](http://hl7.org/fhir/overview-dev.html)
* [ ] Take a few minutes to familiarize yourself with the [FHIR Standard](http://hl7.org/fhir/) for health data exchange. In particular, you might want to read the [Executive Summary](http://hl7.org/fhir/summary.html) and the [Developer Introduction](http://hl7.org/fhir/overview-dev.html)

* [ ] In addition, take a few minutes to familiarize yourself with [Angular](https://angular.io/docs). Understand the basics of component structures, HTTP calls, and other basics covered in the [Fundamentals](https://angular.io/guide/architecture) section.
* [ ] Use whatever library & framework you're most comfortable with.

* [ ] Create your own GitHub project and copy the contents of this repository into your own project (please don't fork this repository)

* [ ] Locate the component `AppComponent` and run it. You should see results pop up in the console of your web browser
* [ ] Create your own GitHub project and copy the contents of this repository into your own project.

* [ ] **Please, do not fork this repo.** Create your own private GitHub repository to do your work in.

### Basic Tasks:

* [ ] Add a table to AppComponent and populate it with results from the `getPatients()` function.

* [ ] Modify the `ApiService` class to include another call that fetches all `Patient` resources whose `birthdate` are between 1960 and 1965 (inclusive).
* [ ] Create a patient view with patients fetched from `https://try.smilecdr.com/baseR4/Patient`. The patients should be sorted by name & birthdate (if a birthdate is in the record).

* [ ] Sort the table based on youngest birthdate to oldest.
* [ ] Display the first & last names, birthdate, address, gender & phone number.

* [ ] Ensure the table is responsive. Ensure there is proper error handling for missing elements in the data.

* [ ] Time the request. Output the time on the footer of the page. Use a pipe for formatting the output.
* [ ] Time the request. Output the time on the footer of the page in a human readable format.

* [ ] Add a search function to the page. Add two inputs to `AppComponent` - a textbox that takes in a name (first or last), and a datepicker. Modify the `ApiService` to include a call that searches for a `Patient` based on the name passed in, and the date of birth passed in from the date picker. The results should be reflected in the table. Use the [SearchParameters section](https://www.hl7.org/fhir/patient.html#search) to help with building your query.
* [ ] Add a search function to the page. Add two inputs to your view - one for first name, and one for last name. Make an API call to `https://try.smilecdr.com/baseR4/Patient?given=<userinput>&family=<userinput>` that searches for a `Patient` based on the names passed in. Replace `<userinput>` with the data from the inputs. If only one name is entered in the inputs, modify the query to only use either the first or last name entered.

* [ ] Apply validation to the inputs - the name box cannot contain non-alphabetic characters, and the date field must be a valid date structure (YYYY/MM/DD).
* [ ] Add a function to reset the search results in the table.

* [ ] Prevent the button search button from multi-clicks wihout using timeouts.
* [ ] Apply validation to the inputs - the boxes cannot contain non-alphabetic characters.

* [ ] Commit your work.

### Intermediate Tasks:

* [ ] In `QuestionnaireComponent`, generate a form using the `questionnaire.json` file in the `assests` folder. The form should have validation applied to each input.
* [ ] All tasks in the [Basic Tasks](#basic-tasks) section must be completed.

* [ ] Using the results from the form, generate a [`QuestionnaireResponse`](https://www.hl7.org/fhir/questionnaireresponse.html). The `QuestionnaireResponse` should follow the structure outlined in the [Resource Content Section](https://www.hl7.org/fhir/questionnaireresponse.html#resource)
* [ ] Create a navbar, implement routing from the patient view to another view, the questionnaire view.

* [ ] Display your results at the bottom of the page.
* [ ] In the questionnaire view, _dynamically_ generate a form and capture the answer for the following questions :-

* [ ] Update the `QuestionnaireComponent` to be mobile-friendly.
- Do you have allergies? **Radio Button (True, False)**
- What is your gender? **Select (Male, Female, Other)**
- What is your date of birth? **Datepicker**
- What is your country of birth? **Textbox**
- What is your marital status? **Select (Married, Single, Divorced)**
- Do you smoke? **Radio Button (True, False)**
- Do you drink alchohol? **Radio Button (True, False)**

* [ ] Please include unit tests for your work.
* [ ] Display the results of the form based on submit at the bottom of the page.

* [ ] Commit your work.

* [ ] **Bonus :-** If dynamic form is generated using the [`questionnaire.json` file](assets/questionnaire.json) in the `assets` folder. The form should have validation applied to each input.

* [ ] **Bonus :-** Using the results from the form, generate a [`QuestionnaireResponse`](https://www.hl7.org/fhir/questionnaireresponse.html). The `QuestionnaireResponse` should follow the structure outlined in the [Resource Content Section](https://www.hl7.org/fhir/questionnaireresponse.html#resource)
131 changes: 0 additions & 131 deletions angular.json

This file was deleted.

93 changes: 93 additions & 0 deletions assets/questionnaire.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"resourceType": "Questionnaire",
"id": "f201",
"url": "http://hl7.org/fhir/Questionnaire/f201",
"status": "active",
"subjectType": [
"Patient"
],
"date": "2021-08-12",
"item": [
{
"linkId": "1",
"text": "Do you have allergies?",
"type": "boolean"
},
{
"linkId": "2",
"text": "What is your gender?",
"type": "choice",
"option": [
{
"valueCoding": {
"system": "http://hl7.fhir/org",
"code": "male",
"display": "Male"
}
},
{
"valueCoding": {
"system": "http://hl7.fhir/org",
"code": "female",
"display": "Female"
}
},
{
"valueCoding": {
"system": "http://hl7.fhir/org",
"code": "other",
"display": "Other"
}
}
]
},
{
"linkId": "3",
"text": "What is your date of birth?",
"type": "date"
},
{
"linkId": "4",
"text": "What is your country of birth?",
"type": "string"
},
{
"linkId": "5",
"text": "What is your marital status?",
"type": "choice",
"option": [
{
"valueCoding": {
"system": "http://hl7.fhir/org",
"code": "married",
"display": "Married"
}
},
{
"valueCoding": {
"system": "http://hl7.fhir/org",
"code": "single",
"display": "Single"
}
},
{
"valueCoding": {
"system": "http://hl7.fhir/org",
"code": "divorced",
"display": "Divorced"
}
}
]
},
{
"linkId": "6",
"text": "Do you smoke?",
"type": "boolean"
},
{
"linkId": "7",
"text": "Do you drink alchohol?",
"type": "boolean"
}
]
}
12 changes: 0 additions & 12 deletions browserslist

This file was deleted.

32 changes: 0 additions & 32 deletions e2e/protractor.conf.js

This file was deleted.

23 changes: 0 additions & 23 deletions e2e/src/app.e2e-spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions e2e/src/app.po.ts

This file was deleted.

Loading