{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$vocabulary": {
        "https://json-schema.org/draft/2020-12/vocab/core": true,
        "https://json-schema.org/draft/2020-12/vocab/applicator": true,
        "https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
        "https://json-schema.org/draft/2020-12/vocab/validation": true,
        "https://json-schema.org/draft/2020-12/vocab/meta-data": true,
        "https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
        "https://json-schema.org/draft/2020-12/vocab/content": true
    },
    "$id": "http://ns.medbiq.org/activity-report",
    "title": "ActivityReport",
    "description": "JSON Schema for MedBiq Activity Report. Copyright 2024 MedBiquitous Consortium. All Rights Reserved. http://www.medbiq.org. Users are bound by the terms of the MedBiquitous Consortium JSON Public License and Terms of Use.",
    "type": "object",
    "$defs": {
        "NonNullStringType": {
            "$ref": "http://medbiq.pixelbytellc.com/common.schema.json#/$defs/NonNullStringType",
            "description": "A string that must have at least one character, based on the NonNullString common JSON schema."
        },
        "UniqueIDType": {
            "$ref": "http://medbiq.pixelbytellc.com/professional-profile/member.schema.json#/$defs/UniqueIDType"
        },
        "ClassificationRelationType": {
            "type": "string",
            "enum": ["Assessment Addresses", "Instruction Addresses"]
        },
        "DEARegistrationType": {
            "type": "string",
            "enum": ["Individual", "Institutional", "None"]
        },
        "IDDomainType": {
            "type": "string",
            "format": "uri",
            "pattern": "^idd:\\S*:\\S*$"
        },
        "PracticeAreaType": {
            "type": "string",
            "enum": [
                "Addiction",
                "Anesthesiology",
                "Critical Care",
                "Dentistry",
                "Emergency",
                "Family Medicine",
                "Geriatric",
                "Hematology",
                "Hospice and/or Palliative Care",
                "Internal Medicine",
                "Neurology",
                "Obstetrics/Gynecology",
                "Oncology",
                "Ophthalmology",
                "Pain",
                "Pediatric",
                "Physical Medicine and Rehabilitation",
                "Psychiatry",
                "General Surgery",
                "Orthopedic surgery",
                "Other surgical specialty",
                "Urology",
                "Other",
                "N/A"
            ]
        },
        "REMSProfessionType": {
            "type": "string",
            "enum": [
                "Physician",
                "Advanced practice nurse",
                "Physician Assistant",
                "Dentist",
                "Podiatrist",
                "Nurse",
                "Pharmacist",
                "Optometrist",
                "Psychologist",
                "Veterinarian",
                "Other healthcare professional",
                "Other"
            ]
        },
        "StatusType": {
            "type": "string",
            "enum": ["Registered", "Completed", "Expired"]
        },
        "TimeInPracticeType": {
            "type": "string",
            "enum": [
                "Trainee",
                "0-5 years post training",
                "6-10 years",
                "11-15 years",
                "16-20 years",
                "21+ years"
            ]
        },
        "ModuleNameType": {
            "type": "object",
            "properties": {
                "_moduleID": {
                    "type": "string"
                },
                "_moduleName": {
                    "type": "string"
                }
            },
            "required": ["_moduleID"]
        },
        "ModuleType": {
            "type": "object",
            "properties": {
                "_ModuleName": {
                    "$ref": "#/$defs/ModuleNameType"
                },
                "_Metadata": {
                    "$ref": "#/$defs/MetadataType"
                },
                "_Status": {
                    "$ref": "#/$defs/StatusType"
                },
                "_StartDateTime": {
                    "type": "string",
                    "format": "date-time"
                },
                "_EndDateTime": {
                    "type": "string",
                    "format": "date-time"
                },
                "_DueDateTime": {
                    "type": "string",
                    "format": "date-time"
                },
                "_RegisteredDateTime": {
                    "type": "string",
                    "format": "date-time"
                },
                "_CompletedDateTime": {
                    "type": "string",
                    "format": "date-time"
                },
                "_ExpiredDateTime": {
                    "type": "string",
                    "format": "date-time"
                },
                "_TimeEngaged": {
                    "type": "string",
                    "format": "duration",
                    "pattern": "^P(?!$)((\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?)(T(\\d+H)?(\\d+M)?(\\d+S)?)?$",
                    "examples": [
                        {
                            "example": "P1Y2M10DT2H30M",
                            "description": "1 year, 2 months, 10 days, 2 hours, and 30 minutes"
                        },
                        {
                            "example": "P3Y6M4DT12H30M5S",
                            "description": "3 years, 6 months, 4 days, 12 hours, 30 minutes, and 5 seconds"
                        },
                        {
                            "example": "PT1H30M",
                            "description": "1 hour and 30 minutes"
                        }
                    ],
                    "description": "Duration format following ISO 8601."
                },
                "_Results": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_CreditCertificate": {
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/CreditCertificateType"
                    }
                },
                "_other": {
                    "type": "array",
                    "items": {
                        "type": "object"
                    },
                    "additionalProperties": true
                }
            },
            "required": ["_ModuleName"]
        },
        "ResourceUsedType": {
            "type": "object",
            "properties": {
                "_Title": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_Collection": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_CollectionID": {
                    "$ref": "#/$defs/CollectionIDType"
                },
                "_ResourceLocation": {
                    "type": "string",
                    "format": "uri"
                },
                "_Relevant": {
                    "type": "boolean"
                }
            },
            "required": ["_Title"]
        },
        "CollectionIDType": {
            "type": "object",
            "properties": {
                "_type": {
                    "type": "string"
                }
            },
            "required": ["_type"]
        },
        "PointOfCareLearningDataType": {
            "type": "object",
            "properties": {
                "_ClinicalQuestionOrTopic": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_SearchParameters": {
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/NonNullStringType"
                    }
                },
                "_ResourceUsed": {
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/ResourceUsedType"
                    }
                },
                "_ApplicationToPractice": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_id": {
                    "type": "string"
                }
            },
            "required": [
                "_ClinicalQuestionOrTopic",
                "_ApplicationToPractice",
                "_ResourceUsed",
                "_id"
            ]
        },
        "ActivityType": {
            "type": "object",
            "properties": {
                "_ProviderOrganization": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_ActivityName": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_ActivityInstanceID": {
                    "$ref": "#/$defs/UniqueIDType"
                },
                "_Status": {
                    "$ref": "#/$defs/StatusType"
                },
                "_LaunchDetails": {
                    "$ref": "#/$defs/LaunchDetailsType"
                },
                "_CommercialSupporter": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_RegulatoryInformation": {
                    "$ref": "#/$defs/RegulatoryInformationType"
                },
                "_Module": {
                    "type": "object",
                    "$ref": "#/$defs/ModuleType"
                },
                "_PointOfCareLearningData": {
                    "$ref": "#/$defs/PointOfCareLearningDataType"
                },
                "_Results": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_other": {
                    "type": "array",
                    "items": {
                        "type": "object"
                    },
                    "additionalProperties": true
                },
                "_activityID": {
                    "type": "string"
                }
            },
            "required": ["_ProviderOrganization", "_ActivityName", "_Module"]
        },
        "ActivityReportType": {
            "type": "object",
            "properties": {
                "_ReportingOrganization": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_users": {
                    "type": "array",
                    "maxItems": 2,
                    "items": {
                        "type": "object",
                        "oneOf": [
                            {
                                "Member": {
                                    "$ref": "http://medbiq.pixelbytellc.com/professional-profile/member.schema.json#/$defs/MemberType"
                                }
                            },
                            {
                                "Participants": {
                                    "$ref": "#/$defs/ParticipantsType"
                                }
                            }
                        ]
                    }
                },
                "_Activity": {
                    "type": "object",
                    "$ref": "#/$defs/ActivityType"
                },
                "_XtensibleInfo": {
                    "type": "object",
                    "$ref": "#/$defs/XtensibleInfoType"
                },
                "_other": {
                    "type": "array",
                    "items": {
                        "type": "object"
                    },
                    "additionalProperties": true
                },
                "_arid": {
                    "type": "string",
                    "format": "URI"
                }
            },
            "required": ["_ReportingOrganization", "_Activity"]
        },
        "CreditCertificateType": {
            "type": "object",
            "properties": {
                "_CreditReceived": {
                    "$ref": "#/$defs/CreditReceivedType"
                },
                "_CreditID": {
                    "type": "string",
                    "format": "uri"
                }
            },
            "required": ["_CreditReceived", "_CreditID"]
        },
        "MetadataType": {
            "oneOf": [
                {
                    "lom": {
                        "$ref": "http://medbiq.pixelbytellc.com/healthcare-learning-object-metadata/healthcarelom.schema.json#/$defs/lom"
                    }
                },
                {
                    "location": {
                        "$ref": "#/$defs/NonNullStringType"
                    }
                }
            ]
        },
        "XtensibleInfoType": {
            "type": "object",
            "properties": {
                "_other": {
                    "type": "array",
                    "items": {
                        "type": "object"
                    }
                }
            },
            "required": ["_other"]
        },

        "CreditReceivedType": {
            "type": "object",
            "properties": {
                "_credits": {
                    "$ref": "http://medbiq.pixelbytellc.com/healthcare-learning-object-metadata/healthcare/healthcaremetadata.schema.json#/$defs/creditsType"
                },
                "_CreditFocus": {
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/CreditFocusType"
                    },
                    "minItems": 0
                }
            },
            "additionalProperties": false
        },

        "CreditFocusType": {
            "type": "object",
            "properties": {
                "_Description": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_Code": {
                    "type": "string"
                },
                "_NumberOfCredits": {
                    "type": "number"
                }
            },
            "required": ["_Description", "_NumberOfCredits"]
        },
        "LaunchDetailsType": {
            "type": "object",
            "properties": {
                "_LaunchAction": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_ActivityLocation": {
                    "type": "string",
                    "format": "uri"
                },
                "_ReturnLocation": {
                    "type": "string",
                    "format": "uri"
                }
            },
            "required": ["_LaunchAction", "_ActivityLocation"]
        },
        "DomainID": {
            "type": "object",
            "properties": {
                "_domain": {
                    "$ref": "#/$defs/IDDomainType"
                }
            },
            "required": ["_domain"]
        },
        "ParticipantType": {
            "type": "object",
            "properties": {
                "_LocalIdentifier": {
                    "$ref": "#/$defs/UniqueIDType"
                },
                "_StateOfPrimaryPractice": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_DEARegistration": {
                    "$ref": "#/$defs/DEARegistrationType"
                },
                "_Profession": {
                    "$ref": "#/$defs/REMSProfessionType"
                },
                "_PracticeArea": {
                    "$ref": "#/$defs/PracticeAreaType"
                },
                "_SurgicalProcedures": {
                    "type": "boolean"
                },
                "_TimeInPractice": {
                    "$ref": "#/$defs/TimeInPracticeType"
                }
            },
            "required": ["_LocalIdentifier", "_Profession"]
        },
        "RegulatoryInformationType": {
            "type": "object",
            "properties": {
                "_CompliantToRegulation": {
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/URIReferenceType"
                    }
                },
                "_RelatedToRegulation": {
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/URIReferenceType"
                    }
                },
                "_RegulatoryClassification": {
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/RegulatoryClassificationType"
                    }
                }
            }
        },
        "URIReferenceType": {
            "type": "object",
            "properties": {
                "_URI": {
                    "type": "string",
                    "format": "uri"
                },
                "_label": {
                    "type": "string"
                }
            },
            "required": ["_URI", "_label"]
        },
        "RegulatoryClassificationType": {
            "type": "object",
            "properties": {
                "_ClassificationRelation": {
                    "$ref": "#/$defs/ClassificationRelationType"
                },
                "_Regulation": {
                    "$ref": "#/$defs/URIReferenceType"
                },
                "_ComponentID": {
                    "$ref": "#/$defs/NonNullStringType"
                },
                "_ComponentTitle": {
                    "$ref": "#/$defs/NonNullStringType"
                }
            },
            "required": [
                "_ClassificationRelation",
                "_Regulation",
                "_ComponentID",
                "_ComponentTitle"
            ]
        },
        "ParticipantsType": {
            "type": "array",
            "items": {
                "$ref": "#/$defs/ParticipantsType"
            }
        }
    },
    "properties": {
        "ActivityReports": {
            "type": "array",
            "item": {
                "properties": {
                    "DateTimeCreated": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "ReportingStartDate": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "ReportingEndDate": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "ActivityReport": {
                        "type": "object",
                        "$ref": "#/$defs/ActivityReportType"
                    },
                    "other": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "additionalProperties": true
                    }
                }
            },
            "required": ["DateTimeCreated", "ActivityReport"]
        }
    }
}
