Git Product home page Git Product logo

Comments (1)

sanjaytkbabu avatar sanjaytkbabu commented on August 23, 2024

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.

valid-record.json

from nrpti.

Related Issues (20)

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.