Comments (1)
Logic for NRIS-EMLI import: https://github.com/bcgov/NRPTI/blob/master/api/src/integrations/nris-emli/datasource.js
API called for obtaining nris-emli records: "https://api.nrs.gov.bc.ca/nrisws-api/v1/emprInspections?inspectionStartDate=2020-01-01&inspectionEndDate=2020-01-15"
inspectionStartDate: 2020-01-01 (Hardcoded)
inspectionEndDate: 2 weeks from start date, for every subsequent call this is incremented 7 days until end date reaches current date.
The following checks are done to find valid complete records that are >= 7 days:
-
//Only import assessmentSubStatus in 'Closed', 'Response Received' or 'Report Sent'
const validassessmentSubStatus = ['Closed', 'Response Received', 'Report Sent']; -
//For 'Response Received' and 'Report Sent' only import records that are 45 days old
if (validassessmentSubStatus.slice(1).includes(record.assessmentSubStatus) && reportDateAge < 45) return false; -
//reject if inspection type isn't Mine Inspection:
if (record.inspection.inspectionSubType !== 'Mine Inspection') return false; -
//reject if assessmentSubType isn't Compliance Review or Inspection
if (record.assessmentSubType !== 'Compliance Review' && record.assessmentSubType !== 'Inspection') return false; -
//reject if inspectionSubType is audit
if (record.inspection.inspectionType[0] === 'Audit') return false;
This is how a valid nris-emli record looks like that is obtained via the api call.
from nrpti.
Related Issues (20)
- Minor typos in HTML HOT 1
- Cleanup Stale Lucy PR's and branches
- Copy of Cleanup Stale Lucy PR's and branches HOT 1
- Gwells Do Not Close - Release PR HOT 1
- Improved ability to share results and records
- Move BC Energy Regulator and associated legislation hardcoded values to the database
- BC Energy Regulator Issuance of Administrative Penalty Records under Environmental Management Act
- Automate publishing of Mines Act inspection records and reports to BC Mines Information web app
- Investigate Work Needed for #1201
- NRCED SSL Cert Renewal - Expires Mar 22 HOT 2
- NRPTI Pipeline: Create and Activate GitHub Webhook
- NRPTI Pipeline: Create OpenShift Tekton Pipelines
- NRPTI Pipeline: Add Hooks for Success/Fail Notifications
- Can't reset passwords in metabase HOT 1
- Replace actName with intermediate value for energy records
- NRPTI Cron Job not completing HOT 1
- NRCED displays incorrect information on the number of records displayed when no records are found
- Permissions not working as expected HOT 1
- Add tests for NRPTI related to changes to act name handling HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nrpti.