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

Latest changes from next-staging #76

Merged
merged 5 commits into from
Dec 17, 2024
Merged
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
12 changes: 6 additions & 6 deletions openfn-69066751-5f2c-459c-b42e-feba1c802383-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,21 @@ workflows:
jobs:
Fetch-Metadata:
name: Fetch Metadata
adaptor: '@openfn/language-http@latest'
adaptor: '@openfn/language-http@6.5.1'
credential: null
body:
path: workflows/wf1/1-fetch-metadata.js

Get-Teis-and-Locations:
name: Get Teis and Locations
adaptor: '@openfn/language-dhis2@latest'
adaptor: '@openfn/language-dhis2@5.0.1'
credential: [email protected]
body:
path: workflows/wf1/2-get-teis-and-locations.js

Create-Patients:
name: Create Patients
adaptor: '@openfn/language-openmrs@latest'
adaptor: '@openfn/language-openmrs@4.1.3'
credential: [email protected]
body:
path: workflows/wf1/3-create-patients.js
Expand Down Expand Up @@ -139,7 +139,7 @@ workflows:
jobs:
Get-Patients:
name: Get Patients
adaptor: '@openfn/language-openmrs@latest'
adaptor: '@openfn/language-openmrs@4.1.3'
credential: [email protected]
body:
path: workflows/wf2/1-get-patients.js
Expand All @@ -153,7 +153,7 @@ workflows:

Get-Encounters:
name: Get Encounters
adaptor: '@openfn/language-http@latest'
adaptor: '@openfn/language-http@6.5.1'
credential: '[email protected](raw)'
body:
path: workflows/wf2/3-get-encounters.js
Expand All @@ -174,7 +174,7 @@ workflows:

Mappings:
name: Mappings
adaptor: '@openfn/language-http@latest'
adaptor: '@openfn/language-http@6.5.1'
credential: null
body:
path: workflows/wf2/2-mappings.js
Expand Down
329 changes: 169 additions & 160 deletions openfn-69066751-5f2c-459c-b42e-feba1c802383-state.json

Large diffs are not rendered by default.

22,700 changes: 22,691 additions & 9 deletions workflows/wf1/1-fetch-metadata.js

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions workflows/wf1/2-get-teis-and-locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ get(
const teis = state.data.instances.filter(
tei => tei.updatedAt >= state.cursor
);
//for testing
//.filter(tei => tei.createdAt > state.cursor) //for prod
//.slice(0, 1); //to limit 1 for testing

console.log(
'# of TEIs found before filter ::',
Expand Down
9 changes: 2 additions & 7 deletions workflows/wf2/1-get-patients.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
//Here we define the date cursor
//$.cursor at beggining of the project 2023-05-20T06:01:24.000+0000
cursor($.lastRunDateTime || $.manualCursor || '2023-05-20T06:01:24.000+0000');
// Update the lastRunDateTime for the next run

cursor('today', {
key: 'lastRunDateTime',
format: c => dateFns.format(new Date(c), "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),
});

searchPatient({ q: 'IQ', v: 'full', limit: '100' });
//searchPatient({ q: 'Katrina', v: 'full', limit: '100' });
//Query all patients (q=all) not supported on demo OpenMRS; needs to be configured
//...so we query all Patients with name "Patient" instead

fn(state => {
const { cursor, data, lastRunDateTime } = state;
console.log('Filtering patients since:', cursor);
console.log('Filtering patients since cursor:', cursor);

const patients = data.results.filter(({ auditInfo }) => {
const lastModified = auditInfo?.dateChanged || auditInfo?.dateCreated;
Expand Down
Loading