Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues/29 add record state #31

Merged
merged 11 commits into from
Dec 13, 2023
21 changes: 13 additions & 8 deletions src/main/java/cz/cvut/kbss/study/model/PatientRecord.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
package cz.cvut.kbss.study.model;

import cz.cvut.kbss.jopa.model.annotations.CascadeType;
import cz.cvut.kbss.jopa.model.annotations.FetchType;
import cz.cvut.kbss.jopa.model.annotations.Id;
import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty;
import cz.cvut.kbss.jopa.model.annotations.OWLClass;
import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty;
import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty;
import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints;
import cz.cvut.kbss.jopa.model.annotations.*;
import cz.cvut.kbss.study.model.qam.Question;
import cz.cvut.kbss.study.model.util.HasOwlKey;

Expand Down Expand Up @@ -52,6 +45,10 @@ public class PatientRecord implements Serializable, HasOwlKey {
CascadeType.REMOVE}, fetch = FetchType.EAGER)
private Question question;

@Enumerated(EnumType.OBJECT_ONE_OF)
@OWLObjectProperty(iri = Vocabulary.s_p_has_state)
blcham marked this conversation as resolved.
Show resolved Hide resolved
private RecordPhase phase;

public URI getUri() {
return uri;
}
Expand Down Expand Up @@ -134,6 +131,14 @@ public void setFormTemplate(String formTemplate) {
this.formTemplate = formTemplate;
}

public RecordPhase getPhase() {
return phase;
}

public void setPhase(RecordPhase phase) {
this.phase = phase;
}

@Override
public String toString() {
return "PatientRecord{" +
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/cz/cvut/kbss/study/model/RecordPhase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cz.cvut.kbss.study.model;

import cz.cvut.kbss.jopa.model.annotations.Individual;

public enum RecordPhase {
@Individual(iri = Vocabulary.s_c_open_record_state)
open(Vocabulary.s_c_open_record_state),
@Individual(iri = Vocabulary.s_c_valid_record_state)
valid(Vocabulary.s_c_valid_record_state),
@Individual(iri = Vocabulary.s_c_completed_record_state)
completed(Vocabulary.s_c_completed_record_state),
@Individual(iri = Vocabulary.s_c_published_record_state)
published(Vocabulary.s_c_published_record_state);

private final String iri;

RecordPhase(String iri) {
this.iri = iri;
}

public String getIri() {
return iri;
}
}
30 changes: 30 additions & 0 deletions src/main/resources/model.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix form: <http://onto.fel.cvut.cz/ontologies/form/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ufo: <http://onto.fel.cvut.cz/ontologies/ufo/> .
@base <http://onto.fel.cvut.cz/ontologies/record-manager> .

<http://onto.fel.cvut.cz/ontologies/record-manager> rdf:type owl:Ontology ;
Expand Down Expand Up @@ -74,6 +75,11 @@ rm:relates-to rdf:type owl:ObjectProperty .
rm:was-treated-at rdf:type owl:ObjectProperty ;
rdfs:subPropertyOf rm:relates-to .

### http://onto.fel.cvut.cz/ontologies/record-manager/has-state
rm:has-state rdf:type owl:ObjectProperty ;
rdfs:subPropertyOf rdf:type ;
rdfs:label "has state"@en .


#################################################################
# Data properties
Expand Down Expand Up @@ -163,5 +169,29 @@ rm:user rdf:type owl:Class ;
rm:impersonator rdf:type owl:Class ;
rdfs:label "Impersonator"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/record-state
rm:record-state rdf:type owl:Class ;
rdfs:subClassOf ufo:phase ;
rdfs:label "record state"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/open-record-state
rm:open-record-state rdf:type owl:Class ;
blcham marked this conversation as resolved.
Show resolved Hide resolved
rdfs:subClassOf rm:record-state ;
rdfs:label "open record state"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/valid-record-state
rm:valid-record-state rdf:type owl:Class ;
rdfs:subClassOf rm:record-state ;
rdfs:label "valid record state"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/completed-record-state
rm:completed-record-state rdf:type owl:Class ;
rdfs:subClassOf rm:record-state ;
rdfs:label "completed record state"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/published-record-state
rm:published-record-state rdf:type owl:Class ;
rdfs:subClassOf rm:record-state ;
rdfs:label "published record state"@en .

### Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi
Loading