-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Summary
While integrating OpenSPP with OpenCRVS via the DCI (Digital Convergence Initiative) API, we identified several differences between the OpenCRVS implementation and the SPDCI API specification v1.0.0. This ticket documents these findings to help improve interoperability.
Environment
- DCI API spec version: v1.0.0
- Testing via: OpenSPP DCI Client
Findings
1. reg_type Field Semantic Mismatch (High Priority)
Spec expectation:
Per the SearchRequest schema, reg_type should contain the registry type:
reg_type:
type: string
description: |
@context:https://schema.spdci.org/common/v1/api-schemas/RegistryType.jsonld
example: "ns:org:RegistryType:Civil"OpenCRVS behavior:
OpenCRVS expects reg_type to contain a lowercase event type (e.g., "birth", "death").
Impact:
This breaks semantic interoperability. Clients following the spec would send reg_type: "ns:org:RegistryType:Civil" and use reg_event_type for event filtering, but OpenCRVS rejects or misinterprets this.
Suggested fix:
- Use
reg_typefor registry type identification - Use
reg_event_typefor event type filtering (BIRTH, DEATH, MARRIAGE, DIVORCE)
2. Missing reg_event_type Support (Medium Priority)
Spec expectation:
The reg_event_type field in search_criteria allows filtering by vital event type.
OpenCRVS behavior:
This field appears to be ignored or not supported. Event type filtering is done via reg_type instead.
3. Envelope Structure - Signature Wrapper (Medium Priority)
Spec expectation:
The DCI envelope structure is:
{
"signature": "...",
"header": { ... },
"message": { ... }
}OpenCRVS behavior:
OpenCRVS expects envelopes without the signature wrapper:
{
"header": { ... },
"message": { ... }
}Suggested fix:
Accept both formats, or document that signature is not supported.
4. Required Fields Stricter Than Spec (Low Priority - Documentation)
OpenCRVS requires fields that are optional in the DCI spec:
consentobject (required by OpenCRVS, optional in spec)localefield (required by OpenCRVS, optional in spec)
This is acceptable behavior (stricter validation), but should be documented for implementers.
5. Expression Query Format (No Action Required)
OpenCRVS uses a MongoDB-style range query format for expression queries:
{
"type": "ns:org:QueryType:expression",
"value": {
"dateOfEvent": {
"type": "range",
"gte": "2024-01-01",
"lte": "2024-12-31"
}
}
}This is valid per DCI spec since expression queries are explicitly implementation-specific. The spec states:
"Query expression's syntax / format is determined based on query-type."
Just documenting for clarity - no fix needed.
6. Predicate Query Support (Feature Request)
Spec definition:
The DCI spec defines a predicate query type with a standardized structure using operators: gt, lt, eq, ge, le, in. This enables interoperable structured queries across implementations.
{
"query_type": "predicate",
"query": [{
"seq_num": 1,
"expression1": { "attribute_name": "dateOfEvent", "operator": "ge", "attribute_value": "2024-01-01" },
"condition": "and",
"expression2": { "attribute_name": "dateOfEvent", "operator": "le", "attribute_value": "2024-12-31" }
}]
}Current state:
OpenCRVS appears to only support expression queries with a custom MongoDB-style format.
Why this matters:
expressionqueries are implementation-specific - each system can use different syntaxpredicatequeries are standardized - any DCI client can construct them without knowing implementation details- For true interoperability, supporting
predicateallows clients to query without custom adapters
Suggested priority: Medium - would significantly improve interoperability with other DCI-compliant systems.
Reproduction Steps
- Send a DCI search request with:
reg_type: "ns:org:RegistryType:Civil"(per spec)reg_event_type: "BIRTH"(per spec)
- Observe that OpenCRVS does not return expected results
- Change to
reg_type: "birth"(OpenCRVS-specific) - Observe that OpenCRVS now works
Suggested Resolution Priority
- High: Fix
reg_typesemantic usage - Medium: Add
reg_event_typesupport - Medium: Accept envelope with signature wrapper
- Medium: Add
predicatequery type support - Low: Document required fields
References
We're happy to collaborate on fixes or provide more details.