From 70642c52d7fef6def465852374ed92cfa1cadd4b Mon Sep 17 00:00:00 2001 From: Josh Humphries Date: Fri, 18 Oct 2024 13:04:31 +0100 Subject: [PATCH] docs: add documentation about the EMu views Just preps for the moment but with the intention to expand later --- dataimporter/emu/views/README.md | 98 ++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 dataimporter/emu/views/README.md diff --git a/dataimporter/emu/views/README.md b/dataimporter/emu/views/README.md new file mode 100644 index 0000000..a50042e --- /dev/null +++ b/dataimporter/emu/views/README.md @@ -0,0 +1,98 @@ +# EMu views + +This directory contains the views derived from EMu data. +Each module contains one view subclass along with any additional functions required to +make the view work. +Additionally, there is a `utils` module containing common functions and variables. + +## Common checks + +### Departments + +In ecatalogue derived views it is common for the first value in the `ColDepartment` +field to be checked against this list of values: + +- Botany +- Entomology +- Mineralogy +- Palaeontology +- Zoology + +If the value is in this list then the record is valid and can proceed with any other +filter checks. + +### Disallowed states + +In ecatalogue derived views it is common for the first value in the `SecRecordStatus` +field to be checked against this list of values: + +- DELETE +- DELETE-MERGED +- DUPLICATION +- Disposed of +- FROZEN ARK +- INVALID +- POSSIBLE TYPE +- PROBLEM +- Re-registered in error +- Reserved +- Retired +- Retired (see Notes) +- SCAN_cat +- See Notes +- Specimen missing - see notes +- Stub +- Stub Record +- Stub record + +If the value matches any of these values it will be rejected. + +## View Definitions + +### preparation + +Represents a preparation record and is published to the sample dataset on the Data +Portal. + +#### Filter flowchart +```mermaid +flowchart TD + START(ecatalogue record) + PREP{ColRecordType is preparation} + MCF{ColSubDepartment is molecular collections} + MGP{ColRecordType is mammal group part} + MAMMALS{ColSubDepartment is ls mammals} + DTOL{NhmSecProjectName first value is Darwin Tree of Life} + WP{AdmPublishWebNoPasswordFlag first value is y} + GUID{AdmGUIDPreferredValue first value is valid GUID} + DIS{SecRecordStatus first value is in list of disallowed states} + DEPT{ColDepartment first value is in list of allowed departments} + LOAN1{LocPermanentLocationRef first value is 3250522} + LOAN2{LocCurrentSummaryData contains the word loan} + NO[Reject] + YES[Success, is preparation record] + + START --> PREP + PREP -->|Yes| MCF + PREP -->|No| MGP + MCF -->|Yes| WP + MCF -->|No| NO + MGP -->|Yes| MAMMALS + MGP -->|No| NO + MAMMALS -->|Yes| DTOL + MAMMALS -->|No| NO + DTOL -->|Yes| WP + DTOL -->|No| NO + WP -->|Yes| GUID + WP -->|No| NO + GUID -->|Yes| DIS + GUID -->|No| NO + DIS -->|No| DEPT + DIS -->|Yes| NO + DEPT -->|Yes| LOAN1 + DEPT -->|No| NO + LOAN1 -->|Yes| LOAN2 + LOAN1 -->|No| NO + LOAN2 -->|Yes| YES + LOAN2 -->|No| NO +```