Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions app/models/entities/DrugWarning.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,8 @@ object DrugWarning extends OTLogging {
implicit val getDrugWarningsFromDB: GetResult[DrugWarnings] =
GetResult(r => Json.parse(r.<<[String]).as[DrugWarnings])
implicit val drugWarningsImpF: OFormat[DrugWarnings] = Json.format[models.entities.DrugWarnings]
implicit val drugWarningsReferenceImpR: Reads[models.entities.DrugWarningReference] = (
(JsPath \ "ref_id").read[String] and
(JsPath \ "ref_type").read[String] and
(JsPath \ "ref_url").read[String]
)(DrugWarningReference.apply)
implicit val drugWarningReferenceImpW: OWrites[DrugWarningReference] =
Json.writes[DrugWarningReference]
implicit val drugWarningImpW: OWrites[models.entities.DrugWarning] = Json.writes[DrugWarning]
implicit val drugWarningImpR: Reads[models.entities.DrugWarning] = (
(JsPath \ "toxicityClass").readNullable[String] and
(JsPath \ "chemblIds").readNullable[Seq[String]] and
(JsPath \ "country").readNullable[String] and
(JsPath \ "description").readNullable[String] and
(JsPath \ "id").readNullable[Long] and
(JsPath \ "references").readNullable[Seq[DrugWarningReference]] and
(JsPath \ "warningType").read[String] and
(JsPath \ "year").readNullable[Int] and
(JsPath \ "efo_term").readNullable[String] and
(JsPath \ "efo_id").readNullable[String] and
(JsPath \ "efo_id_for_warning_class").readNullable[String]
)(DrugWarning.apply)
implicit val drugWarningsReferenceImpF: OFormat[models.entities.DrugWarningReference] =
Json.format[models.entities.DrugWarningReference]
implicit val drugWarningImpF: OFormat[models.entities.DrugWarning] =
Json.format[models.entities.DrugWarning]
}
10 changes: 1 addition & 9 deletions app/models/entities/Interactions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,10 @@ object Interactions extends OTLogging {
GetResult(r => Json.parse(r.<<[String]).as[InteractionResources])
implicit val interactionEvidencePDMF: OFormat[InteractionEvidencePDM] =
Json.format[InteractionEvidencePDM]

implicit val interactionSpeciesW: OWrites[InteractionSpecies] = Json.writes[InteractionSpecies]
implicit val interactionSpeciesR: Reads[InteractionSpecies] =
((__ \ "mnemonic").read[String] and
(__ \ "scientific_name").readNullable[String] and
(__ \ "taxon_id").readNullable[Long])(InteractionSpecies.apply)

implicit val interactionSpeciesF: OFormat[InteractionSpecies] = Json.format[InteractionSpecies]
implicit val interactionResourcesF: OFormat[InteractionResources] =
Json.format[InteractionResources]

implicit val interactionEvidenceF: OFormat[InteractionEvidence] = Json.format[InteractionEvidence]

implicit val interactionF: OFormat[Interaction] = Json.format[Interaction]
implicit val interactionsF: OFormat[Interactions] = Json.format[Interactions]
}
2 changes: 1 addition & 1 deletion app/models/entities/Target.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ case class SafetyLiability(

case class CancerHallmark(description: String, impact: Option[String], label: String, pmid: Long)

case class HallmarkAttribute(attribute_name: String, description: String, pmid: Option[Long])
case class HallmarkAttribute(name: String, description: String, pmid: Option[Long])

case class Hallmarks(cancerHallmarks: Seq[CancerHallmark], attributes: Seq[HallmarkAttribute])

Expand Down
3 changes: 1 addition & 2 deletions app/models/gql/Objects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,7 @@ object Objects extends OTLogging {
implicit val hallmarksAttributeImp: ObjectType[Backend, HallmarkAttribute] =
deriveObjectType[Backend, HallmarkAttribute](
ObjectTypeDescription("Attributes of the hallmark annotation"),
RenameField("attribute_name", "name"),
DocumentField("attribute_name", "Name of the hallmark attribute"),
DocumentField("name", "Name of the hallmark attribute"),
DocumentField("description", "Description of the hallmark attribute"),
DocumentField(
"pmid",
Expand Down