commit b1a8b4280c5bbd2eb4969d83d8bd24540332c12e Author: Paul-Christian Volkmer Date: Wed Jul 10 16:11:26 2024 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8aba0b4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +*.user + +.idea/ +TestResults/ + +*/bin/ +*/obj/ \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..0ff54b0 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Paul-Christian Volkmer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/MV64e.MTB.Test/MV64e.MTB.Test.csproj b/MV64e.MTB.Test/MV64e.MTB.Test.csproj new file mode 100644 index 0000000..8a801ff --- /dev/null +++ b/MV64e.MTB.Test/MV64e.MTB.Test.csproj @@ -0,0 +1,40 @@ + + + + net8.0 + enable + enable + + false + true + 10 + + + + + + + + + + + + + + + + + + + + + + + + + + Always + + + + diff --git a/MV64e.MTB.Test/MtbTest.cs b/MV64e.MTB.Test/MtbTest.cs new file mode 100644 index 0000000..0ca7454 --- /dev/null +++ b/MV64e.MTB.Test/MtbTest.cs @@ -0,0 +1,23 @@ +using System.Diagnostics; +using System.Reflection; + +namespace MV64e.MTB.Test; + +public class MtbTest +{ + [Test] + public void ShouldParseJsonData() + { + var assembly = Assembly.GetExecutingAssembly(); + const string resourceName = @"MV64e.MTB.Test.TestData.mv64e-mtb-fake-patient.json"; + + using var stream = assembly.GetManifestResourceStream(resourceName); + Debug.Assert(stream != null, "Cannot find test data file"); + using var reader = new StreamReader(stream); + + var json = reader.ReadToEnd(); + var mtb = Mtb.FromJson(json); + + Assert.IsNotNull(mtb); + } +} \ No newline at end of file diff --git a/MV64e.MTB.Test/TestData/mv64e-mtb-fake-patient.json b/MV64e.MTB.Test/TestData/mv64e-mtb-fake-patient.json new file mode 100644 index 0000000..ebe4439 --- /dev/null +++ b/MV64e.MTB.Test/TestData/mv64e-mtb-fake-patient.json @@ -0,0 +1 @@ +{"patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","gender":{"code":"male","display":"Männlich","system":"Gender"},"birthDate":"1977-03-15","dateOfDeath":"2008-03-15","healthInsurance":{"extId":{"value":"aok-ik","system":"IK"},"display":"AOK","type":"Organization"},"age":{"value":31,"unit":"Years"},"vitalStatus":{"code":"deceased","display":"Verstorben","system":"dnpm-dip/patient/vital-status"}},"consent":{},"episodesOfCare":[{"id":"d0634bb6-83d9-4c19-beb5-206bddd7513a","transferTan":"cda64713-7b31-402e-89f9-8fa8f9809507","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"period":{"start":"2024-01-09"},"diagnoses":[{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","type":"MTBDiagnosis"}]}],"diagnoses":[{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"recordedOn":"2004-05-15","code":{"code":"C76.7","display":"Bösartige Neubildung: Sonstige ungenau bezeichnete Lokalisationen","system":"http://fhir.de/CodeSystem/bfarm/icd-10-gm","version":"2024"},"topography":{"code":"C76.7","display":"Sonstiger mangelhaft bezeichneter Sitz","system":"urn:oid:2.16.840.1.113883.6.43.1","version":"Zweite Revision"},"tumorGrade":{"code":"G2","display":"G2 – mäßig differenziert","system":"dnpm-dip/mtb/tumor-grade"},"whoGrading":{"code":"2","display":"Diffuse astrocytoma","system":"dnpm-dip/mtb/who-grading-cns-tumors","version":"2021"},"stageHistory":[{"stage":{"code":"local","display":"Lokal","system":"dnpm-dip/mtb/diagnosis/tumor-spread"},"date":"2024-07-09"}],"guidelineTreatmentStatus":{"code":"impossible","display":"Leitlinientherapie nicht möglich","system":"dnpm-dip/diagnosis/guideline-therapy/status"}}],"guidelineTherapies":[{"id":"386ba653-0b20-4801-9eb0-f937ed8a54e9","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"indication":{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","display":"Bösartige Neubildung: Sonstige ungenau bezeichnete Lokalisationen","type":"MTBDiagnosis"},"therapyLine":3,"recordedOn":"2024-07-09","status":{"code":"stopped","display":"Abgebrochen","system":"dnpm-dip/therapy/status"},"statusReason":{"code":"progression","display":"Progression","system":"dnpm-dip/therapy/status-reason"},"period":{"start":"2022-08-09","end":"2023-02-14"},"medication":[{"code":"L01FX12","display":"Tafasitamab","system":"http://fhir.de/CodeSystem/bfarm/atc","version":"2024"}],"notes":"Notes on the therapy..."},{"id":"f3a7e152-0f86-4646-b671-29f083019783","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"indication":{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","display":"Bösartige Neubildung: Sonstige ungenau bezeichnete Lokalisationen","type":"MTBDiagnosis"},"therapyLine":6,"recordedOn":"2024-07-09","status":{"code":"stopped","display":"Abgebrochen","system":"dnpm-dip/therapy/status"},"statusReason":{"code":"progression","display":"Progression","system":"dnpm-dip/therapy/status-reason"},"period":{"start":"2023-02-09","end":"2023-08-10"},"medication":[{"code":"L01FX28","display":"Glofitamab","system":"http://fhir.de/CodeSystem/bfarm/atc","version":"2024"}],"notes":"Notes on the therapy..."}],"guidelineProcedures":[{"id":"43f81705-9e17-41d3-ae05-06958dd33d37","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"indication":{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","display":"Bösartige Neubildung: Sonstige ungenau bezeichnete Lokalisationen","type":"MTBDiagnosis"},"code":{"code":"radio-therapy","display":"Strahlen-Therapie","system":"dnpm-dip/mtb/procedure/type"},"status":{"code":"completed","display":"Abgeschlossen","system":"dnpm-dip/therapy/status"},"statusReason":{"code":"progression","display":"Progression","system":"dnpm-dip/therapy/status-reason"},"therapyLine":8,"recordedOn":"2024-07-09","period":{"start":"2024-01-09"},"notes":"Notes on the therapy..."},{"id":"89594d3d-0708-4620-8803-fa5de0e64a9d","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"indication":{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","display":"Bösartige Neubildung: Sonstige ungenau bezeichnete Lokalisationen","type":"MTBDiagnosis"},"code":{"code":"surgery","display":"OP","system":"dnpm-dip/mtb/procedure/type"},"status":{"code":"on-going","display":"Laufend","system":"dnpm-dip/therapy/status"},"statusReason":{"code":"continued-externally","display":"Weiterbehandlung extern","system":"dnpm-dip/therapy/status-reason"},"therapyLine":8,"recordedOn":"2024-07-09","period":{"start":"2024-01-09"},"notes":"Notes on the therapy..."}],"performanceStatus":[{"id":"99f246e6-fb8c-40c4-880c-1e2e5658cbf6","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"effectiveDate":"2024-07-09","value":{"code":"3","display":"ECOG 3","system":"ECOG-Performance-Status"}}],"specimens":[{"id":"5760dfb4-9012-454c-b315-5deafe999c8f","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"diagnosis":{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","type":"MTBDiagnosis"},"type":{"code":"fresh-tissue","display":"Frischgewebe","system":"dnpm-dip/mtb/tumor-specimen/type"},"collection":{"date":"2024-07-09","method":{"code":"liquid-biopsy","display":"Liquid Biopsy","system":"dnpm-dip/mtb/tumor-specimen/collection/method"},"localization":{"code":"metastasis","display":"Metastase","system":"dnpm-dip/mtb/tumor-specimen/collection/localization"}}}],"histologyReports":[{"id":"ac78c911-238b-46e5-9bd5-36304e70174a","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"specimen":{"id":"5760dfb4-9012-454c-b315-5deafe999c8f","type":"TumorSpecimen"},"issuedOn":"2024-07-09","results":{"tumorMorphology":{"id":"dc18063a-89b9-4eca-a485-557368450cf7","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"specimen":{"id":"5760dfb4-9012-454c-b315-5deafe999c8f","type":"TumorSpecimen"},"value":{"code":"8201/2","display":"Kribriformes Carcinoma in situ [C50.-]","system":"urn:oid:2.16.840.1.113883.6.43.1","version":"Zweite Revision"},"notes":"Notes..."},"tumorCellContent":{"id":"cc19e1bb-178b-4264-9afd-0ba62c35d95f","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"specimen":{"id":"5760dfb4-9012-454c-b315-5deafe999c8f","type":"TumorSpecimen"},"method":{"code":"histologic","display":"Histologisch","system":"dnpm-dip/mtb/tumor-cell-content/method"},"value":0.6964126464218567}}}],"ihcReports":[{"id":"2c97573a-f4dd-4c75-a630-7422cbe888f3","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"specimen":{"id":"5760dfb4-9012-454c-b315-5deafe999c8f","type":"TumorSpecimen"},"date":"2024-07-09","journalId":{"value":"de45bb4c-ef64-4028-a55e-8a3d73842e6d"},"blockId":{"value":"93a9a7d9-54b8-4182-9da9-320f1a7fae02"},"proteinExpressionResults":[{"id":"60b82433-c0a6-4d0f-85e9-40f63b28ca22","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"protein":{"code":"HGNC:11998","display":"TP53","system":"https://www.genenames.org/"},"value":{"code":"3+","display":"3+","system":"dnpm-dip/mtb/ihc/protein-expression/result"},"tpsScore":27,"icScore":{"code":"0","display":"< 1%","system":"dnpm-dip/mtb/ihc/protein-expression/ic-score"},"tcScore":{"code":"2","display":">= 5%","system":"dnpm-dip/mtb/ihc/protein-expression/tc-score"}},{"id":"ecfab030-b3e4-4c33-a50b-e8933c9b3593","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"protein":{"code":"HGNC:1097","display":"BRAF","system":"https://www.genenames.org/"},"value":{"code":"not-exp","display":"Nicht exprimiert","system":"dnpm-dip/mtb/ihc/protein-expression/result"},"tpsScore":87,"icScore":{"code":"2","display":">= 5%","system":"dnpm-dip/mtb/ihc/protein-expression/ic-score"},"tcScore":{"code":"1","display":">= 1%","system":"dnpm-dip/mtb/ihc/protein-expression/tc-score"}},{"id":"3eab7c68-bf01-462a-8c55-7306c4ce8ea6","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"protein":{"code":"HGNC:11998","display":"TP53","system":"https://www.genenames.org/"},"value":{"code":"3+","display":"3+","system":"dnpm-dip/mtb/ihc/protein-expression/result"},"tpsScore":88,"icScore":{"code":"2","display":">= 5%","system":"dnpm-dip/mtb/ihc/protein-expression/ic-score"},"tcScore":{"code":"4","display":">= 25%","system":"dnpm-dip/mtb/ihc/protein-expression/tc-score"}},{"id":"b0bb41e1-27a6-48c2-ae16-b3a40c463e68","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"protein":{"code":"HGNC:5173","display":"HRAS","system":"https://www.genenames.org/"},"value":{"code":"1+","display":"1+","system":"dnpm-dip/mtb/ihc/protein-expression/result"},"tpsScore":60,"icScore":{"code":"0","display":"< 1%","system":"dnpm-dip/mtb/ihc/protein-expression/ic-score"},"tcScore":{"code":"2","display":">= 5%","system":"dnpm-dip/mtb/ihc/protein-expression/tc-score"}}],"msiMmrResults":[]}],"ngsReports":[{"id":"4cbfc863-1977-4293-8141-96a4ef411fe9","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"specimen":{"id":"5760dfb4-9012-454c-b315-5deafe999c8f","type":"TumorSpecimen"},"issuedOn":"2024-07-09","sequencingType":{"code":"exome","display":"Exome","system":"dnpm-dip/ngs/sequencing-type"},"metadata":[{"kitType":"Kit Type","kitManufacturer":"Manufacturer","sequencer":"Sequencer","referenceGenome":"HG19","pipeline":"https://github.com/pipeline-project"}],"results":{"tumorCellContent":{"id":"0aaa088d-da71-498b-8f5b-67851642fc3b","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"specimen":{"id":"5760dfb4-9012-454c-b315-5deafe999c8f","type":"TumorSpecimen"},"method":{"code":"bioinformatic","display":"Bioinformatisch","system":"dnpm-dip/mtb/tumor-cell-content/method"},"value":0.8488462340782923},"tmb":{"id":"32008349-cf95-47a0-b5fe-0a692e96184f","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"specimen":{"id":"5760dfb4-9012-454c-b315-5deafe999c8f","type":"TumorSpecimen"},"value":{"value":298193,"unit":"Mutations per megabase"},"interpretation":{"code":"low","display":"Niedrig","system":"dnpm-dip/mtb/ngs/tmb/interpretation"}},"brcaness":{"id":"6fec2a4c-d354-441d-8bd1-51ceb0094abc","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"specimen":{"id":"5760dfb4-9012-454c-b315-5deafe999c8f","type":"TumorSpecimen"},"value":0.5,"confidenceRange":{"min":0.4,"max":0.6}},"hrdScore":{"id":"43a0f938-cb49-4f09-988e-4d7bdcafcd00","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"specimen":{"id":"5760dfb4-9012-454c-b315-5deafe999c8f","type":"TumorSpecimen"},"value":0.06698695819348954,"components":{"lst":0.3949619863732128,"loh":0.8542926541406639,"tai":0.5884686564371258},"interpretation":{"code":"low","display":"Niedrig","system":"dnpm-dip/mtb/ngs/hrd-score/interpretation"}},"simpleVariants":[{"id":"ab846e35-c4c1-4ead-a7ba-f070b03c155e","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"externalIds":[{"value":"70f5a7bb-9b7f-48ac-a236-fb7968a68f7d","system":"https://www.ncbi.nlm.nih.gov/snp/"},{"value":"afe100b1-375b-471c-ba0d-d11c578764e9","system":"https://cancer.sanger.ac.uk/cosmic"}],"chromosome":{"code":"chr2","display":"chr2","system":"chromosome"},"gene":{"code":"HGNC:6407","display":"KRAS","system":"https://www.genenames.org/"},"transcriptId":{"value":"9eedaa8a-085e-440c-8f2d-665830944ce9","system":"https://www.ensembl.org/index.html"},"position":{"start":497},"altAllele":"G","refAllele":"C","dnaChange":{"code":"c.497C>G","system":"https://hgvs-nomenclature.org"},"proteinChange":{"code":"p.Lys23_Val25del","system":"https://hgvs-nomenclature.org"},"readDepth":9,"allelicFrequency":0.14597505331005867,"interpretation":{"code":"3","display":"Uncertain significance","system":"https://www.ncbi.nlm.nih.gov/clinvar/"}},{"id":"546c0677-a7b7-4d55-b3d8-5151457b023d","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"externalIds":[{"value":"299b3cac-3ad2-4203-9754-a7613ee8dea5","system":"https://www.ncbi.nlm.nih.gov/snp/"},{"value":"22f767c3-b359-401e-a0b1-647adffe3ee9","system":"https://cancer.sanger.ac.uk/cosmic"}],"chromosome":{"code":"chr4","display":"chr4","system":"chromosome"},"gene":{"code":"HGNC:5173","display":"HRAS","system":"https://www.genenames.org/"},"transcriptId":{"value":"34357423-91b1-46c3-b9a4-b9e236d07d7d","system":"https://www.ensembl.org/index.html"},"position":{"start":449},"altAllele":"T","refAllele":"C","dnaChange":{"code":"c.449C>T","system":"https://hgvs-nomenclature.org"},"proteinChange":{"code":"p.Lys23_Val25del","system":"https://hgvs-nomenclature.org"},"readDepth":21,"allelicFrequency":0.929058459806847,"interpretation":{"code":"4","display":"Likely pathogenic","system":"https://www.ncbi.nlm.nih.gov/clinvar/"}},{"id":"30f5ad5a-ac59-4fc2-af19-9321d5aad4ea","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"externalIds":[{"value":"c27a1775-dbba-42af-9641-9c26c44c3866","system":"https://www.ncbi.nlm.nih.gov/snp/"},{"value":"a6fab5be-b2b5-4260-8a2c-681d9cfef100","system":"https://cancer.sanger.ac.uk/cosmic"}],"chromosome":{"code":"chr9","display":"chr9","system":"chromosome"},"gene":{"code":"HGNC:6407","display":"KRAS","system":"https://www.genenames.org/"},"transcriptId":{"value":"b82aafff-afc1-40fe-bde0-e5b7f3c06b9d","system":"https://www.ensembl.org/index.html"},"position":{"start":199},"altAllele":"G","refAllele":"T","dnaChange":{"code":"c.199T>G","system":"https://hgvs-nomenclature.org"},"proteinChange":{"code":"p.(Glu125_Ala132delinsGlyLeuHisArgPheIleValLeu)","system":"https://hgvs-nomenclature.org"},"readDepth":23,"allelicFrequency":0.6280972522555942,"interpretation":{"code":"0","display":"Not Applicable","system":"https://www.ncbi.nlm.nih.gov/clinvar/"}},{"id":"dffc6391-c2dd-4114-9b35-21048b16a5e8","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"externalIds":[{"value":"9c2af2ba-c400-4bdc-aa45-bcffa01b86c0","system":"https://www.ncbi.nlm.nih.gov/snp/"},{"value":"00be47f4-d2ac-4c90-9569-3909693e050b","system":"https://cancer.sanger.ac.uk/cosmic"}],"chromosome":{"code":"chr2","display":"chr2","system":"chromosome"},"gene":{"code":"HGNC:3690","display":"FGFR3","system":"https://www.genenames.org/"},"transcriptId":{"value":"bc9d7f41-1e33-44c6-8854-32ba14c7bc85","system":"https://www.ensembl.org/index.html"},"position":{"start":446},"altAllele":"A","refAllele":"C","dnaChange":{"code":"c.446C>A","system":"https://hgvs-nomenclature.org"},"proteinChange":{"code":"p.Cys28delinsTrpVal","system":"https://hgvs-nomenclature.org"},"readDepth":6,"allelicFrequency":0.8192427503946907,"interpretation":{"code":"2","display":"Likely benign","system":"https://www.ncbi.nlm.nih.gov/clinvar/"}},{"id":"97021fec-3038-4d40-a923-a7185f2dd45c","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"externalIds":[{"value":"b3e669b9-daec-4020-a876-fe8cd984ec07","system":"https://www.ncbi.nlm.nih.gov/snp/"},{"value":"5328e42e-bcd2-4dd2-ac2c-e52d860e7cdb","system":"https://cancer.sanger.ac.uk/cosmic"}],"chromosome":{"code":"chr4","display":"chr4","system":"chromosome"},"gene":{"code":"HGNC:391","display":"AKT1","system":"https://www.genenames.org/"},"transcriptId":{"value":"02e810a2-a8ee-48fa-98ee-c2555dedec2b","system":"https://www.ensembl.org/index.html"},"position":{"start":181},"altAllele":"C","refAllele":"G","dnaChange":{"code":"c.181G>C","system":"https://hgvs-nomenclature.org"},"proteinChange":{"code":"p.(His321Leufs*3)","system":"https://hgvs-nomenclature.org"},"readDepth":18,"allelicFrequency":0.9486252825502527,"interpretation":{"code":"0","display":"Not Applicable","system":"https://www.ncbi.nlm.nih.gov/clinvar/"}}],"copyNumberVariants":[{"id":"67f5f94a-7210-4298-832b-79cbd8c3f602","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"chromosome":{"code":"chr19","display":"chr19","system":"chromosome"},"startRange":{"start":16044,"end":16086},"endRange":{"start":16189,"end":16239},"totalCopyNumber":1,"relativeCopyNumber":0.21581784365462364,"cnA":0.2529681162704943,"cnB":0.09643290658258796,"reportedAffectedGenes":[{"code":"HGNC:391","display":"AKT1","system":"https://www.genenames.org/"}],"reportedFocality":"partial q-arm","type":{"code":"loss","display":"Loss","system":"dnpm-dip/mtb/ngs-report/cnv/type"},"copyNumberNeutralLoH":[{"code":"HGNC:6407","display":"KRAS","system":"https://www.genenames.org/"}]},{"id":"81916886-c2bb-43c2-b3b1-8205b731aae5","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"chromosome":{"code":"chr21","display":"chr21","system":"chromosome"},"startRange":{"start":39802,"end":39844},"endRange":{"start":40267,"end":40317},"totalCopyNumber":3,"relativeCopyNumber":0.6944561507132927,"cnA":0.7565931684718212,"cnB":0.7741518026256429,"reportedAffectedGenes":[{"code":"HGNC:6407","display":"KRAS","system":"https://www.genenames.org/"},{"code":"HGNC:1097","display":"BRAF","system":"https://www.genenames.org/"},{"code":"HGNC:1100","display":"BRCA1","system":"https://www.genenames.org/"}],"reportedFocality":"partial q-arm","type":{"code":"low-level-gain","display":"Low-level-gain","system":"dnpm-dip/mtb/ngs-report/cnv/type"},"copyNumberNeutralLoH":[{"code":"HGNC:3689","display":"FGFR2","system":"https://www.genenames.org/"}]},{"id":"1aaf355a-62ef-40ec-ac84-2ed6b64c25ce","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"chromosome":{"code":"chr2","display":"chr2","system":"chromosome"},"startRange":{"start":7155,"end":7197},"endRange":{"start":7284,"end":7334},"totalCopyNumber":2,"relativeCopyNumber":0.11504463549534216,"cnA":0.6489287849115875,"cnB":0.13740853100802786,"reportedAffectedGenes":[{"code":"HGNC:391","display":"AKT1","system":"https://www.genenames.org/"},{"code":"HGNC:5173","display":"HRAS","system":"https://www.genenames.org/"},{"code":"HGNC:1100","display":"BRCA1","system":"https://www.genenames.org/"}],"reportedFocality":"partial q-arm","type":{"code":"low-level-gain","display":"Low-level-gain","system":"dnpm-dip/mtb/ngs-report/cnv/type"},"copyNumberNeutralLoH":[{"code":"HGNC:76","display":"ABL1","system":"https://www.genenames.org/"}]},{"id":"773f6c76-faaf-47bf-b554-709679935b9e","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"chromosome":{"code":"chr19","display":"chr19","system":"chromosome"},"startRange":{"start":7321,"end":7363},"endRange":{"start":7867,"end":7917},"totalCopyNumber":1,"relativeCopyNumber":0.7259188532974242,"cnA":0.5950764310251827,"cnB":0.5384386131573586,"reportedAffectedGenes":[{"code":"HGNC:5173","display":"HRAS","system":"https://www.genenames.org/"}],"reportedFocality":"partial q-arm","type":{"code":"loss","display":"Loss","system":"dnpm-dip/mtb/ngs-report/cnv/type"},"copyNumberNeutralLoH":[{"code":"HGNC:3689","display":"FGFR2","system":"https://www.genenames.org/"},{"code":"HGNC:6407","display":"KRAS","system":"https://www.genenames.org/"}]},{"id":"4e7107e4-bbc6-41cc-b6fe-37e65b96ab57","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"chromosome":{"code":"chr19","display":"chr19","system":"chromosome"},"startRange":{"start":16016,"end":16058},"endRange":{"start":16601,"end":16651},"totalCopyNumber":7,"relativeCopyNumber":0.20090926699505263,"cnA":0.022847976828443195,"cnB":0.4081382139537255,"reportedAffectedGenes":[{"code":"HGNC:1097","display":"BRAF","system":"https://www.genenames.org/"},{"code":"HGNC:76","display":"ABL1","system":"https://www.genenames.org/"},{"code":"HGNC:1100","display":"BRCA1","system":"https://www.genenames.org/"}],"reportedFocality":"partial q-arm","type":{"code":"high-level-gain","display":"High-level-gain","system":"dnpm-dip/mtb/ngs-report/cnv/type"},"copyNumberNeutralLoH":[{"code":"HGNC:5173","display":"HRAS","system":"https://www.genenames.org/"},{"code":"HGNC:3690","display":"FGFR3","system":"https://www.genenames.org/"}]},{"id":"d80eb862-7d46-453e-83e4-575c16d8a2f1","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"chromosome":{"code":"chrY","display":"chrY","system":"chromosome"},"startRange":{"start":12500,"end":12542},"endRange":{"start":12791,"end":12841},"totalCopyNumber":7,"relativeCopyNumber":0.6146868961350509,"cnA":0.05361036969744892,"cnB":0.7939811403382872,"reportedAffectedGenes":[{"code":"HGNC:6973","display":"MDM2","system":"https://www.genenames.org/"},{"code":"HGNC:391","display":"AKT1","system":"https://www.genenames.org/"},{"code":"HGNC:3689","display":"FGFR2","system":"https://www.genenames.org/"}],"reportedFocality":"partial q-arm","type":{"code":"high-level-gain","display":"High-level-gain","system":"dnpm-dip/mtb/ngs-report/cnv/type"},"copyNumberNeutralLoH":[{"code":"HGNC:6973","display":"MDM2","system":"https://www.genenames.org/"},{"code":"HGNC:391","display":"AKT1","system":"https://www.genenames.org/"}]}],"dnaFusions":[],"rnaFusions":[],"rnaSeqs":[]}}],"carePlans":[{"id":"6906ca1b-8169-471d-9156-e807654fae8a","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"indication":{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","display":"Bösartige Neubildung: Sonstige ungenau bezeichnete Lokalisationen","type":"MTBDiagnosis"},"issuedOn":"2024-07-09","statusReason":{"code":"no-target","display":"Keine Therapeutische Konsequenz","system":"dnpm-dip/mtb/careplan/status-reason"},"medicationRecommendations":[{"id":"dcb9b2c7-7311-4801-9675-948f00870070","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"indication":{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","display":"Bösartige Neubildung: Sonstige ungenau bezeichnete Lokalisationen","type":"MTBDiagnosis"},"issuedOn":"2024-07-09","levelOfEvidence":{"grading":{"code":"m4","display":"m4","system":"dnpm-dip/mtb/level-of-evidence/grading"},"addendums":[{"code":"R","display":"R","system":"dnpm-dip/mtb/level-of-evidence/addendum"}],"publications":[{"extId":{"value":"1173657729","system":"https://pubmed.ncbi.nlm.nih.gov/"},"type":"Publication"}]},"priority":{"code":"1","display":"1","system":"dnpm-dip/therapy-recommendation/priority"},"medication":[{"code":"L01EX08","display":"Lenvatinib","system":"http://fhir.de/CodeSystem/bfarm/atc","version":"2024"}],"supportingVariants":[{"id":"4e7107e4-bbc6-41cc-b6fe-37e65b96ab57","display":"CNV BRAF,ABL1,BRCA1 High-level-gain","type":"Variant"}]},{"id":"4478c7f1-cdcf-41f5-8245-7da7784279ef","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"indication":{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","display":"Bösartige Neubildung: Sonstige ungenau bezeichnete Lokalisationen","type":"MTBDiagnosis"},"issuedOn":"2024-07-09","levelOfEvidence":{"grading":{"code":"m2B","display":"m2B","system":"dnpm-dip/mtb/level-of-evidence/grading"},"addendums":[{"code":"R","display":"R","system":"dnpm-dip/mtb/level-of-evidence/addendum"}],"publications":[{"extId":{"value":"855039712","system":"https://pubmed.ncbi.nlm.nih.gov/"},"type":"Publication"}]},"priority":{"code":"4","display":"4","system":"dnpm-dip/therapy-recommendation/priority"},"medication":[{"code":"L01FX05","display":"Brentuximab vedotin","system":"http://fhir.de/CodeSystem/bfarm/atc","version":"2024"}],"supportingVariants":[{"id":"ab846e35-c4c1-4ead-a7ba-f070b03c155e","display":"SNV KRAS p.Lys23_Val25del","type":"Variant"}]}],"geneticCounselingRecommendation":{"id":"432f3ff8-ac56-4139-94c9-fa685bc37130","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"issuedOn":"2024-07-09","reason":{"code":"secondary-tumor","display":"Zweittumor","system":"dnpm-dip/mtb/recommendation/genetic-counseling/reason"}},"studyEnrollmentRecommendations":[{"id":"fac762fb-288f-4e26-a2f2-ccdf03c9804d","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"reason":{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","display":"Bösartige Neubildung: Sonstige ungenau bezeichnete Lokalisationen","type":"MTBDiagnosis"},"issuedOn":"2024-07-09","levelOfEvidence":{"code":"m4","display":"m4","system":"dnpm-dip/mtb/level-of-evidence/grading"},"supportingVariants":[{"id":"4e7107e4-bbc6-41cc-b6fe-37e65b96ab57","display":"CNV BRAF,ABL1,BRCA1 High-level-gain","type":"Variant"}],"studies":[{"value":"NCT:21972101","system":"NCT"}]}],"notes":"Protocol of the MTB conference..."}],"claims":[{"id":"b5dd7735-0dfc-49c4-ac4d-f17ee5b3afe8","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"recommendation":{"id":"dcb9b2c7-7311-4801-9675-948f00870070","type":"MTBMedicationRecommendation"},"issuedOn":"2024-07-09","stage":{"code":"initial-claim","display":"Erstantrag","system":"dnpm-dip/mtb/claim/stage"}},{"id":"ba800730-ad27-4723-a4dc-dd02bfd96f79","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"recommendation":{"id":"4478c7f1-cdcf-41f5-8245-7da7784279ef","type":"MTBMedicationRecommendation"},"issuedOn":"2024-07-09","stage":{"code":"initial-claim","display":"Erstantrag","system":"dnpm-dip/mtb/claim/stage"}}],"claimResponses":[{"id":"4d70791b-1727-4a80-8afc-ee655acfdb77","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"claim":{"id":"b5dd7735-0dfc-49c4-ac4d-f17ee5b3afe8","type":"Claim"},"issuedOn":"2024-07-09","status":{"code":"rejected","display":"Abgelehnt","system":"dnpm-dip/mtb/claim-response/status"},"statusReason":{"code":"unknown","display":"Unbekant","system":"dnpm-dip/mtb/claim-response/status-reason"}},{"id":"82ecffc7-5ac8-47d7-9697-27061c1b1c53","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"claim":{"id":"ba800730-ad27-4723-a4dc-dd02bfd96f79","type":"Claim"},"issuedOn":"2024-07-09","status":{"code":"rejected","display":"Abgelehnt","system":"dnpm-dip/mtb/claim-response/status"},"statusReason":{"code":"unknown","display":"Unbekant","system":"dnpm-dip/mtb/claim-response/status-reason"}}],"therapies":[{"history":[{"id":"6f0f1bb5-7633-4834-8ed4-0efb43bcaf42","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"indication":{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","display":"Bösartige Neubildung: Sonstige ungenau bezeichnete Lokalisationen","type":"MTBDiagnosis"},"basedOn":{"id":"dcb9b2c7-7311-4801-9675-948f00870070","type":"MTBMedicationRecommendation"},"recordedOn":"2024-07-09","status":{"code":"on-going","display":"Laufend","system":"dnpm-dip/therapy/status"},"period":{"start":"2007-09-29","end":"2008-03-15"},"medication":[{"code":"L01EX08","display":"Lenvatinib","system":"http://fhir.de/CodeSystem/bfarm/atc","version":"2024"}],"notes":"Notes on the therapy..."}]},{"history":[{"id":"634aa031-a4a1-4137-8895-07dcb543e245","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"indication":{"id":"2b478ee3-f5c0-4429-8367-7215b1908a19","display":"Bösartige Neubildung: Sonstige ungenau bezeichnete Lokalisationen","type":"MTBDiagnosis"},"basedOn":{"id":"4478c7f1-cdcf-41f5-8245-7da7784279ef","type":"MTBMedicationRecommendation"},"recordedOn":"2024-07-09","status":{"code":"not-done","display":"Nicht umgesetzt","system":"dnpm-dip/therapy/status"},"statusReason":{"code":"payment-refused","display":"Kostenübernahme abgelehnt","system":"dnpm-dip/therapy/status-reason"},"notes":"Notes on the therapy..."}]}],"responses":[{"id":"f9e27ff2-0b65-4416-86cd-2b4085fd92a2","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"therapy":{"id":"6f0f1bb5-7633-4834-8ed4-0efb43bcaf42","type":"MTBMedicationTherapy"},"effectiveDate":"2008-01-12","value":{"code":"CR","display":"Complete Response","system":"RECIST"}},{"id":"9231408b-bc7e-482a-808b-3af09b212dad","patient":{"id":"fbd23d0b-f81b-4a2f-b53b-e93871069cfd","type":"Patient"},"therapy":{"id":"634aa031-a4a1-4137-8895-07dcb543e245","type":"MTBMedicationTherapy"},"effectiveDate":"2024-07-09","value":{"code":"SD","display":"Stable Disease","system":"RECIST"}}]} \ No newline at end of file diff --git a/MV64e.MTB/MV64e.MTB.csproj b/MV64e.MTB/MV64e.MTB.csproj new file mode 100644 index 0000000..9f078b4 --- /dev/null +++ b/MV64e.MTB/MV64e.MTB.csproj @@ -0,0 +1,13 @@ + + + + netstandard2.0 + 10 + enable + + + + + + + diff --git a/MV64e.MTB/Mtb.cs b/MV64e.MTB/Mtb.cs new file mode 100644 index 0000000..eb4a4d7 --- /dev/null +++ b/MV64e.MTB/Mtb.cs @@ -0,0 +1,2514 @@ +#pragma warning disable CS8765 +#pragma warning disable CS8618 + +namespace MV64e.MTB +{ + using System; + using System.Collections.Generic; + + using System.Globalization; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + + public partial class Mtb + { + [JsonProperty("carePlans", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List CarePlans { get; set; } + + [JsonProperty("claimResponses", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List ClaimResponses { get; set; } + + [JsonProperty("claims", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List Claims { get; set; } + + [JsonProperty("consent", Required = Required.Always)] + public Consent Consent { get; set; } + + [JsonProperty("diagnoses", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List Diagnoses { get; set; } + + [JsonProperty("ecogStatus", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List EcogStatus { get; set; } + + [JsonProperty("episode", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public MtbEpisode Episode { get; set; } + + [JsonProperty("geneticCounsellingRequests", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List GeneticCounsellingRequests { get; set; } + + [JsonProperty("histologyReports", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List HistologyReports { get; set; } + + [JsonProperty("lastGuidelineTherapies", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List LastGuidelineTherapies { get; set; } + + [JsonProperty("molecularTherapies", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List MolecularTherapies { get; set; } + + [JsonProperty("ngsReports", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List NgsReports { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public MtbPatient Patient { get; set; } + + [JsonProperty("previousGuidelineTherapies", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List PreviousGuidelineTherapies { get; set; } + + [JsonProperty("recommendations", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List Recommendations { get; set; } + + [JsonProperty("responses", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List Responses { get; set; } + + [JsonProperty("specimens", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List Specimens { get; set; } + + [JsonProperty("studyInclusionRequests", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List StudyInclusionRequests { get; set; } + } + + public partial class MtbCarePlan + { + [JsonProperty("description", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Description { get; set; } + + [JsonProperty("diagnosis", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Diagnosis { get; set; } + + [JsonProperty("geneticCounsellingRequest", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string GeneticCounsellingRequest { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("issuedOn", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public DateTimeOffset? IssuedOn { get; set; } + + [JsonProperty("noTargetFinding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public NoTargetFinding NoTargetFinding { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("recommendations", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List Recommendations { get; set; } + + [JsonProperty("studyInclusionRequests", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List StudyInclusionRequests { get; set; } + } + + public partial class NoTargetFinding + { + [JsonProperty("diagnosis", Required = Required.Always)] + public string Diagnosis { get; set; } + + [JsonProperty("issuedOn", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public DateTimeOffset? IssuedOn { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + } + + public partial class Patient + { + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("type", Required = Required.Always)] + public PatientType Type { get; set; } + } + + public partial class ClaimResponse + { + [JsonProperty("claim", Required = Required.Always)] + public ClaimResponseClaim Claim { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("issuedOn", Required = Required.Always)] + public DateTimeOffset IssuedOn { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("reason", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public ClaimResponseStatusReason? Reason { get; set; } + + [JsonProperty("status", Required = Required.Always)] + public CodingClaimResponseStatus Status { get; set; } + } + + public partial class ClaimResponseClaim + { + [JsonProperty("id", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public ClaimResponseClaimType? Type { get; set; } + } + + public partial class CodingClaimResponseStatus + { + [JsonProperty("code", Required = Required.Always)] + public ClaimResponseStatus Code { get; set; } + + [JsonProperty("display", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Display { get; set; } + + [JsonProperty("system", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string System { get; set; } + } + + public partial class Claim + { + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("issuedOn", Required = Required.Always)] + public DateTimeOffset IssuedOn { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("therapy", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Therapy { get; set; } + } + + public partial class Consent + { + [JsonProperty("id", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("patient", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public Patient Patient { get; set; } + + [JsonProperty("status", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public ConsentStatus? Status { get; set; } + } + + public partial class MtbDiagnosis + { + [JsonProperty("code", Required = Required.Always)] + public Coding Code { get; set; } + + [JsonProperty("guidelineTreatmentStatus", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public Coding GuidelineTreatmentStatus { get; set; } + + [JsonProperty("histologyResults", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List HistologyResults { get; set; } + + [JsonProperty("icdO3T", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public Coding IcdO3T { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("recordedOn", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public DateTimeOffset? RecordedOn { get; set; } + + [JsonProperty("statusHistory", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List StatusHistory { get; set; } + + [JsonProperty("whoGrade", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public Coding WhoGrade { get; set; } + } + + public partial class Coding + { + [JsonProperty("code", Required = Required.Always)] + public string Code { get; set; } + + [JsonProperty("display", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Display { get; set; } + + [JsonProperty("system", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string System { get; set; } + + [JsonProperty("version", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Version { get; set; } + } + + public partial class StatusHistory + { + [JsonProperty("date", Required = Required.Always)] + public DateTimeOffset Date { get; set; } + + [JsonProperty("status", Required = Required.Always)] + public MtbDiagnosisTumorSpread Status { get; set; } + } + + public partial class PerformanceStatus + { + [JsonProperty("effectiveDate", Required = Required.Always)] + public DateTimeOffset EffectiveDate { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("value", Required = Required.Always)] + public CodingEcog Value { get; set; } + } + + public partial class CodingEcog + { + [JsonProperty("code", Required = Required.Always)] + public PurpleCode Code { get; set; } + + [JsonProperty("display", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Display { get; set; } + + [JsonProperty("system", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string System { get; set; } + + [JsonProperty("version", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Version { get; set; } + } + + public partial class MtbEpisode + { + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("period", Required = Required.Always)] + public PeriodLocalDate Period { get; set; } + } + + public partial class PeriodLocalDate + { + [JsonProperty("end", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public DateTimeOffset? End { get; set; } + + [JsonProperty("start", Required = Required.Always)] + public DateTimeOffset Start { get; set; } + } + + public partial class GeneticCounselingRecommendation + { + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("issuedOn", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public DateTimeOffset? IssuedOn { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("reason", Required = Required.Always)] + public string Reason { get; set; } + } + + public partial class HistologyReport + { + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("issuedOn", Required = Required.Always)] + public DateTimeOffset IssuedOn { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("specimen", Required = Required.Always)] + public HistologyReportSpecimen Specimen { get; set; } + + [JsonProperty("tumorCellContent", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public TumorCellContent TumorCellContent { get; set; } + + [JsonProperty("tumorMorphology", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public TumorMorphology TumorMorphology { get; set; } + } + + public partial class HistologyReportSpecimen + { + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("type", Required = Required.Always)] + public SpecimenType Type { get; set; } + } + + public partial class TumorCellContent + { + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("method", Required = Required.Always)] + public TumorCellContentMethod Method { get; set; } + + [JsonProperty("specimen", Required = Required.Always)] + public string Specimen { get; set; } + + [JsonProperty("value", Required = Required.Always)] + public double Value { get; set; } + } + + public partial class TumorMorphology + { + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("note", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Note { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("specimen", Required = Required.Always)] + public string Specimen { get; set; } + + [JsonProperty("value", Required = Required.Always)] + public Coding Value { get; set; } + } + + public partial class MtbMedicationTherapy + { + [JsonProperty("basedOn", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string BasedOn { get; set; } + + [JsonProperty("diagnosis", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Diagnosis { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("medication", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List Medication { get; set; } + + [JsonProperty("notDoneReason", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public CodingTherapyStatusReason NotDoneReason { get; set; } + + [JsonProperty("note", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Note { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("period", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public PeriodLocalDate Period { get; set; } + + [JsonProperty("reasonStopped", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public CodingTherapyStatusReason ReasonStopped { get; set; } + + [JsonProperty("recordedOn", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public DateTimeOffset? RecordedOn { get; set; } + + [JsonProperty("status", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public TherapyStatus? Status { get; set; } + + [JsonProperty("therapyLine", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public long? TherapyLine { get; set; } + } + + public partial class CodingTherapyStatusReason + { + [JsonProperty("code", Required = Required.Always)] + public NotDoneReasonCode Code { get; set; } + + [JsonProperty("display", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Display { get; set; } + + [JsonProperty("system", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string System { get; set; } + + [JsonProperty("version", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Version { get; set; } + } + + public partial class MolecularTherapy + { + [JsonProperty("history", Required = Required.Always)] + public List History { get; set; } + } + + public partial class SomaticNgsReport + { + [JsonProperty("brcaness", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public double? Brcaness { get; set; } + + [JsonProperty("copyNumberVariants", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List CopyNumberVariants { get; set; } + + [JsonProperty("dnaFusions", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List DnaFusions { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("issueDate", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public DateTimeOffset? IssueDate { get; set; } + + [JsonProperty("metadata", Required = Required.Always)] + public List Metadata { get; set; } + + [JsonProperty("msi", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public double? Msi { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("rnaFusions", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List RnaFusions { get; set; } + + [JsonProperty("rnaSeqs", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List RnaSeqs { get; set; } + + [JsonProperty("sequencingType", Required = Required.Always)] + public Coding SequencingType { get; set; } + + [JsonProperty("simpleVariants", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List SimpleVariants { get; set; } + + [JsonProperty("specimen", Required = Required.Always)] + public NgsReportSpecimen Specimen { get; set; } + + [JsonProperty("tmb", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public double? Tmb { get; set; } + + [JsonProperty("tumorCellContent", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public TumorCellContent TumorCellContent { get; set; } + } + + public partial class Cnv + { + [JsonProperty("chromosome", Required = Required.Always)] + public Chromosome Chromosome { get; set; } + + [JsonProperty("cnA", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public double? CnA { get; set; } + + [JsonProperty("cnB", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public double? CnB { get; set; } + + [JsonProperty("copyNumberNeutralLoH", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List CopyNumberNeutralLoH { get; set; } + + [JsonProperty("endRange", Required = Required.Always)] + public EndRange EndRange { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("relativeCopyNumber", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public double? RelativeCopyNumber { get; set; } + + [JsonProperty("reportedAffectedGenes", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List ReportedAffectedGenes { get; set; } + + [JsonProperty("reportedFocality", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string ReportedFocality { get; set; } + + [JsonProperty("startRange", Required = Required.Always)] + public StartRange StartRange { get; set; } + + [JsonProperty("totalCopyNumber", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public long? TotalCopyNumber { get; set; } + + [JsonProperty("type", Required = Required.Always)] + public CnvType Type { get; set; } + } + + public partial class CopyNumberNeutralLoH + { + [JsonProperty("ensemblId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string EnsemblId { get; set; } + + [JsonProperty("hgncId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string HgncId { get; set; } + } + + public partial class EndRange + { + [JsonProperty("end", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public double? End { get; set; } + + [JsonProperty("start", Required = Required.Always)] + public double Start { get; set; } + } + + public partial class ReportedAffectedGene + { + [JsonProperty("ensemblId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string EnsemblId { get; set; } + + [JsonProperty("hgncId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string HgncId { get; set; } + } + + public partial class StartRange + { + [JsonProperty("end", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public double? End { get; set; } + + [JsonProperty("start", Required = Required.Always)] + public double Start { get; set; } + } + + public partial class DnaFusion + { + [JsonProperty("fusionPartner3prime", Required = Required.Always)] + public DnaFusionFusionPartner3Prime FusionPartner3Prime { get; set; } + + [JsonProperty("fusionPartner5prime", Required = Required.Always)] + public DnaFusionFusionPartner5Prime FusionPartner5Prime { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("reportedNumReads", Required = Required.Always)] + public long ReportedNumReads { get; set; } + } + + public partial class DnaFusionFusionPartner3Prime + { + [JsonProperty("chromosome", Required = Required.Always)] + public Chromosome Chromosome { get; set; } + + [JsonProperty("gene", Required = Required.Always)] + public PurpleGene Gene { get; set; } + + [JsonProperty("position", Required = Required.Always)] + public double Position { get; set; } + } + + public partial class PurpleGene + { + [JsonProperty("ensemblId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string EnsemblId { get; set; } + + [JsonProperty("hgncId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string HgncId { get; set; } + } + + public partial class DnaFusionFusionPartner5Prime + { + [JsonProperty("chromosome", Required = Required.Always)] + public Chromosome Chromosome { get; set; } + + [JsonProperty("gene", Required = Required.Always)] + public FluffyGene Gene { get; set; } + + [JsonProperty("position", Required = Required.Always)] + public double Position { get; set; } + } + + public partial class FluffyGene + { + [JsonProperty("ensemblId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string EnsemblId { get; set; } + + [JsonProperty("hgncId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string HgncId { get; set; } + } + + public partial class Metadatum + { + [JsonProperty("kitManufacturer", Required = Required.Always)] + public string KitManufacturer { get; set; } + + [JsonProperty("kitType", Required = Required.Always)] + public string KitType { get; set; } + + [JsonProperty("pipeline", Required = Required.Always)] + public Uri Pipeline { get; set; } + + [JsonProperty("referenceGenome", Required = Required.Always)] + public string ReferenceGenome { get; set; } + + [JsonProperty("sequencer", Required = Required.Always)] + public string Sequencer { get; set; } + } + + public partial class RnaFusion + { + [JsonProperty("cosmicId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string CosmicId { get; set; } + + [JsonProperty("effect", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Effect { get; set; } + + [JsonProperty("fusionPartner3prime", Required = Required.Always)] + public RnaFusionFusionPartner3Prime FusionPartner3Prime { get; set; } + + [JsonProperty("fusionPartner5prime", Required = Required.Always)] + public RnaFusionFusionPartner5Prime FusionPartner5Prime { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("reportedNumReads", Required = Required.Always)] + public long ReportedNumReads { get; set; } + } + + public partial class RnaFusionFusionPartner3Prime + { + [JsonProperty("exon", Required = Required.Always)] + public string Exon { get; set; } + + [JsonProperty("gene", Required = Required.Always)] + public TentacledGene Gene { get; set; } + + [JsonProperty("position", Required = Required.Always)] + public double Position { get; set; } + + [JsonProperty("strand", Required = Required.Always)] + public RnaFusionStrand Strand { get; set; } + + [JsonProperty("transcriptId", Required = Required.Always)] + public string TranscriptId { get; set; } + } + + public partial class TentacledGene + { + [JsonProperty("ensemblId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string EnsemblId { get; set; } + + [JsonProperty("hgncId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string HgncId { get; set; } + } + + public partial class RnaFusionFusionPartner5Prime + { + [JsonProperty("exon", Required = Required.Always)] + public string Exon { get; set; } + + [JsonProperty("gene", Required = Required.Always)] + public StickyGene Gene { get; set; } + + [JsonProperty("position", Required = Required.Always)] + public double Position { get; set; } + + [JsonProperty("strand", Required = Required.Always)] + public RnaFusionStrand Strand { get; set; } + + [JsonProperty("transcriptId", Required = Required.Always)] + public string TranscriptId { get; set; } + } + + public partial class StickyGene + { + [JsonProperty("ensemblId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string EnsemblId { get; set; } + + [JsonProperty("hgncId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string HgncId { get; set; } + } + + public partial class RnaSeq + { + [JsonProperty("cohortRanking", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public long? CohortRanking { get; set; } + + [JsonProperty("ensemblId", Required = Required.Always)] + public string EnsemblId { get; set; } + + [JsonProperty("entrezId", Required = Required.Always)] + public string EntrezId { get; set; } + + [JsonProperty("fragmentsPerKilobaseMillion", Required = Required.Always)] + public double FragmentsPerKilobaseMillion { get; set; } + + [JsonProperty("fromNGS", Required = Required.Always)] + public bool FromNgs { get; set; } + + [JsonProperty("gene", Required = Required.Always)] + public RnaSeqGene Gene { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("librarySize", Required = Required.Always)] + public long LibrarySize { get; set; } + + [JsonProperty("rawCounts", Required = Required.Always)] + public long RawCounts { get; set; } + + [JsonProperty("tissueCorrectedExpression", Required = Required.Always)] + public bool TissueCorrectedExpression { get; set; } + + [JsonProperty("transcriptId", Required = Required.Always)] + public string TranscriptId { get; set; } + } + + public partial class RnaSeqGene + { + [JsonProperty("ensemblId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string EnsemblId { get; set; } + + [JsonProperty("hgncId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string HgncId { get; set; } + } + + public partial class Snv + { + [JsonProperty("allelicFrequency", Required = Required.Always)] + public double AllelicFrequency { get; set; } + + [JsonProperty("altAllele", Required = Required.Always)] + public string AltAllele { get; set; } + + [JsonProperty("aminoAcidChange", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public Coding AminoAcidChange { get; set; } + + [JsonProperty("chromosome", Required = Required.Always)] + public Chromosome Chromosome { get; set; } + + [JsonProperty("cosmicId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string CosmicId { get; set; } + + [JsonProperty("dbSNPId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string DbSnpId { get; set; } + + [JsonProperty("dnaChange", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public Coding DnaChange { get; set; } + + [JsonProperty("gene", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public SimpleVariantGene Gene { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("interpretation", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public Coding Interpretation { get; set; } + + [JsonProperty("readDepth", Required = Required.Always)] + public long ReadDepth { get; set; } + + [JsonProperty("refAllele", Required = Required.Always)] + public string RefAllele { get; set; } + + [JsonProperty("startEnd", Required = Required.Always)] + public StartEnd StartEnd { get; set; } + } + + public partial class SimpleVariantGene + { + [JsonProperty("ensemblId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string EnsemblId { get; set; } + + [JsonProperty("hgncId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string HgncId { get; set; } + } + + public partial class StartEnd + { + [JsonProperty("end", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public double? End { get; set; } + + [JsonProperty("start", Required = Required.Always)] + public double Start { get; set; } + } + + public partial class NgsReportSpecimen + { + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("type", Required = Required.Always)] + public SpecimenType Type { get; set; } + } + + public partial class MtbPatient + { + [JsonProperty("address", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public Address Address { get; set; } + + [JsonProperty("birthDate", Required = Required.Always)] + public DateTimeOffset BirthDate { get; set; } + + [JsonProperty("dateOfDeath", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public DateTimeOffset? DateOfDeath { get; set; } + + [JsonProperty("gender", Required = Required.Always)] + public CodingGender Gender { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("insurance", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Insurance { get; set; } + } + + public partial class Address + { + [JsonProperty("municipalityCode", Required = Required.Always)] + public string MunicipalityCode { get; set; } + } + + public partial class CodingGender + { + [JsonProperty("code", Required = Required.Always)] + public Gender Code { get; set; } + + [JsonProperty("display", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Display { get; set; } + + [JsonProperty("system", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string System { get; set; } + + [JsonProperty("version", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Version { get; set; } + } + + public partial class MtbMedicationRecommendation + { + [JsonProperty("diagnosis", Required = Required.Always)] + public string Diagnosis { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("issuedOn", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public DateTimeOffset? IssuedOn { get; set; } + + [JsonProperty("levelOfEvidence", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public LevelOfEvidence LevelOfEvidence { get; set; } + + [JsonProperty("medication", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List Medication { get; set; } + + [JsonProperty("ngsReport", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string NgsReport { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("priority", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public TherapyRecommendationPriority? Priority { get; set; } + + [JsonProperty("supportingVariants", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List SupportingVariants { get; set; } + } + + public partial class LevelOfEvidence + { + [JsonProperty("addendums", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List Addendums { get; set; } + + [JsonProperty("grading", Required = Required.Always)] + public CodingLevelOfEvidenceGrading Grading { get; set; } + + [JsonProperty("publications", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public List Publications { get; set; } + } + + public partial class CodingLevelOfEvidenceAddendum + { + [JsonProperty("code", Required = Required.Always)] + public AddendumCode Code { get; set; } + + [JsonProperty("display", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Display { get; set; } + + [JsonProperty("system", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string System { get; set; } + + [JsonProperty("version", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Version { get; set; } + } + + public partial class CodingLevelOfEvidenceGrading + { + [JsonProperty("code", Required = Required.Always)] + public GradingCode Code { get; set; } + + [JsonProperty("display", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Display { get; set; } + + [JsonProperty("system", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string System { get; set; } + + [JsonProperty("version", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Version { get; set; } + } + + public partial class ReferencePublication + { + [JsonProperty("extId", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public ExtId ExtId { get; set; } + + [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Type { get; set; } + + [JsonProperty("uri", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Uri { get; set; } + } + + public partial class ExtId + { + [JsonProperty("system", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public SystemEnum? System { get; set; } + + [JsonProperty("value", Required = Required.Always)] + public string Value { get; set; } + } + + public partial class Response + { + [JsonProperty("effectiveDate", Required = Required.Always)] + public DateTimeOffset EffectiveDate { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("therapy", Required = Required.Always)] + public ResponseTherapy Therapy { get; set; } + + [JsonProperty("value", Required = Required.Always)] + public CodingRecist Value { get; set; } + } + + public partial class ResponseTherapy + { + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("type", Required = Required.Always)] + public ResponseTherapyType Type { get; set; } + } + + public partial class CodingRecist + { + [JsonProperty("code", Required = Required.Always)] + public FluffyCode Code { get; set; } + + [JsonProperty("display", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Display { get; set; } + + [JsonProperty("system", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string System { get; set; } + + [JsonProperty("version", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Version { get; set; } + } + + public partial class TumorSpecimen + { + [JsonProperty("collection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public Collection Collection { get; set; } + + [JsonProperty("icd10", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public Coding Icd10 { get; set; } + + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public CodingTumorSpecimenType Type { get; set; } + } + + public partial class Collection + { + [JsonProperty("date", Required = Required.Always)] + public DateTimeOffset Date { get; set; } + + [JsonProperty("localization", Required = Required.Always)] + public CodingTumorSpecimenCollectionLocalization Localization { get; set; } + + [JsonProperty("method", Required = Required.Always)] + public CodingTumorSpecimenCollectionMethod Method { get; set; } + } + + public partial class CodingTumorSpecimenCollectionLocalization + { + [JsonProperty("code", Required = Required.Always)] + public TumorSpecimenCollectionLocalization Code { get; set; } + + [JsonProperty("display", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Display { get; set; } + + [JsonProperty("system", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string System { get; set; } + } + + public partial class CodingTumorSpecimenCollectionMethod + { + [JsonProperty("code", Required = Required.Always)] + public TumorSpecimenCollectionMethod Code { get; set; } + + [JsonProperty("display", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Display { get; set; } + + [JsonProperty("system", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string System { get; set; } + } + + public partial class CodingTumorSpecimenType + { + [JsonProperty("code", Required = Required.Always)] + public TumorSpecimenType Code { get; set; } + + [JsonProperty("display", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string Display { get; set; } + + [JsonProperty("system", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public string System { get; set; } + } + + public partial class StudyEnrollmentRecommendation + { + [JsonProperty("id", Required = Required.Always)] + public string Id { get; set; } + + [JsonProperty("issuedOn", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] + public DateTimeOffset? IssuedOn { get; set; } + + [JsonProperty("nctNumber", Required = Required.Always)] + public string NctNumber { get; set; } + + [JsonProperty("patient", Required = Required.Always)] + public Patient Patient { get; set; } + + [JsonProperty("reason", Required = Required.Always)] + public string Reason { get; set; } + } + + public enum PatientType { Patient }; + + public enum ClaimResponseClaimType { Claim }; + + public enum ClaimResponseStatusReason { ApprovalRevocation, FormalReasons, InclusionInStudy, InsufficientEvidence, Other, OtherTherapyRecommended, StandardTherapyNotExhausted, Unknown }; + + public enum ClaimResponseStatus { Accepted, Rejected, Unknown }; + + public enum ConsentStatus { Active, Rejected }; + + public enum MtbDiagnosisTumorSpread { Local, Metastasized, TumorFree, Unknown }; + + public enum PurpleCode { Code0, Code1, Code2, Code3, Code4 }; + + public enum SpecimenType { TumorSpecimen }; + + public enum TumorCellContentMethod { Bioinformatic, Histologic }; + + public enum NotDoneReasonCode { ChronicRemission, ContinuedExternally, Deterioration, LostToFu, MedicalReason, NoIndication, Other, OtherTherapyChosen, PatientDeath, PatientRefusal, PatientWish, PaymentEnded, PaymentPending, PaymentRefused, Progression, Toxicity, Unknown }; + + public enum TherapyStatus { Completed, NotDone, OnGoing, Stopped, Unknown }; + + public enum Chromosome { Chr1, Chr10, Chr11, Chr12, Chr13, Chr14, Chr15, Chr16, Chr17, Chr18, Chr19, Chr2, Chr20, Chr21, Chr22, Chr3, Chr4, Chr5, Chr6, Chr7, Chr8, Chr9, ChrX, ChrY }; + + public enum CnvType { HighLevelGain, Loss, LowLevelGain }; + + public enum RnaFusionStrand { Empty, RnaFusionStrand }; + + public enum Gender { Female, Male, Other, Unknown }; + + public enum AddendumCode { Is, Iv, R, Z }; + + public enum GradingCode { M1A, M1B, M1C, M2A, M2B, M2C, M3, M4, Undefined }; + + public enum SystemEnum { HttpsPubmedNcbiNlmNihGov }; + + public enum TherapyRecommendationPriority { Priority1, Priority2, Priority3, Priority4 }; + + public enum ResponseTherapyType { MtbMedicationTherapy }; + + public enum FluffyCode { Cr, Mr, Na, Nya, Pd, Pr, Sd }; + + public enum TumorSpecimenCollectionLocalization { Metastasis, PrimaryTumor, Unknown }; + + public enum TumorSpecimenCollectionMethod { Biopsy, Cytology, LiquidBiopsy, Resection, Unknown }; + + public enum TumorSpecimenType { CryoFrozen, Ffpe, FreshTissue, LiquidBiopsy, Unknown }; + + public partial class Mtb + { + public static Mtb FromJson(string json) => JsonConvert.DeserializeObject(json, Converter.Settings); + } + + public static class Serialize + { + public static string ToJson(this Mtb self) => JsonConvert.SerializeObject(self, Converter.Settings); + } + + internal static class Converter + { + public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings + { + MetadataPropertyHandling = MetadataPropertyHandling.Ignore, + DateParseHandling = DateParseHandling.None, + Converters = + { + PatientTypeConverter.Singleton, + ClaimResponseClaimTypeConverter.Singleton, + ClaimResponseStatusReasonConverter.Singleton, + ClaimResponseStatusConverter.Singleton, + ConsentStatusConverter.Singleton, + MtbDiagnosisTumorSpreadConverter.Singleton, + PurpleCodeConverter.Singleton, + SpecimenTypeConverter.Singleton, + TumorCellContentMethodConverter.Singleton, + NotDoneReasonCodeConverter.Singleton, + TherapyStatusConverter.Singleton, + ChromosomeConverter.Singleton, + CnvTypeConverter.Singleton, + RnaFusionStrandConverter.Singleton, + GenderConverter.Singleton, + AddendumCodeConverter.Singleton, + GradingCodeConverter.Singleton, + SystemEnumConverter.Singleton, + TherapyRecommendationPriorityConverter.Singleton, + ResponseTherapyTypeConverter.Singleton, + FluffyCodeConverter.Singleton, + TumorSpecimenCollectionLocalizationConverter.Singleton, + TumorSpecimenCollectionMethodConverter.Singleton, + TumorSpecimenTypeConverter.Singleton, + new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal } + }, + }; + } + + internal class PatientTypeConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(PatientType) || t == typeof(PatientType?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + if (value == "Patient") + { + return PatientType.Patient; + } + throw new Exception("Cannot unmarshal type PatientType"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (PatientType)untypedValue; + if (value == PatientType.Patient) + { + serializer.Serialize(writer, "Patient"); + return; + } + throw new Exception("Cannot marshal type PatientType"); + } + + public static readonly PatientTypeConverter Singleton = new PatientTypeConverter(); + } + + internal class ClaimResponseClaimTypeConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(ClaimResponseClaimType) || t == typeof(ClaimResponseClaimType?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + if (value == "Claim") + { + return ClaimResponseClaimType.Claim; + } + throw new Exception("Cannot unmarshal type ClaimResponseClaimType"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (ClaimResponseClaimType)untypedValue; + if (value == ClaimResponseClaimType.Claim) + { + serializer.Serialize(writer, "Claim"); + return; + } + throw new Exception("Cannot marshal type ClaimResponseClaimType"); + } + + public static readonly ClaimResponseClaimTypeConverter Singleton = new ClaimResponseClaimTypeConverter(); + } + + internal class ClaimResponseStatusReasonConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(ClaimResponseStatusReason) || t == typeof(ClaimResponseStatusReason?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "approval-revocation": + return ClaimResponseStatusReason.ApprovalRevocation; + case "formal-reasons": + return ClaimResponseStatusReason.FormalReasons; + case "inclusion-in-study": + return ClaimResponseStatusReason.InclusionInStudy; + case "insufficient-evidence": + return ClaimResponseStatusReason.InsufficientEvidence; + case "other": + return ClaimResponseStatusReason.Other; + case "other-therapy-recommended": + return ClaimResponseStatusReason.OtherTherapyRecommended; + case "standard-therapy-not-exhausted": + return ClaimResponseStatusReason.StandardTherapyNotExhausted; + case "unknown": + return ClaimResponseStatusReason.Unknown; + } + throw new Exception("Cannot unmarshal type ClaimResponseStatusReason"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (ClaimResponseStatusReason)untypedValue; + switch (value) + { + case ClaimResponseStatusReason.ApprovalRevocation: + serializer.Serialize(writer, "approval-revocation"); + return; + case ClaimResponseStatusReason.FormalReasons: + serializer.Serialize(writer, "formal-reasons"); + return; + case ClaimResponseStatusReason.InclusionInStudy: + serializer.Serialize(writer, "inclusion-in-study"); + return; + case ClaimResponseStatusReason.InsufficientEvidence: + serializer.Serialize(writer, "insufficient-evidence"); + return; + case ClaimResponseStatusReason.Other: + serializer.Serialize(writer, "other"); + return; + case ClaimResponseStatusReason.OtherTherapyRecommended: + serializer.Serialize(writer, "other-therapy-recommended"); + return; + case ClaimResponseStatusReason.StandardTherapyNotExhausted: + serializer.Serialize(writer, "standard-therapy-not-exhausted"); + return; + case ClaimResponseStatusReason.Unknown: + serializer.Serialize(writer, "unknown"); + return; + } + throw new Exception("Cannot marshal type ClaimResponseStatusReason"); + } + + public static readonly ClaimResponseStatusReasonConverter Singleton = new ClaimResponseStatusReasonConverter(); + } + + internal class ClaimResponseStatusConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(ClaimResponseStatus) || t == typeof(ClaimResponseStatus?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "accepted": + return ClaimResponseStatus.Accepted; + case "rejected": + return ClaimResponseStatus.Rejected; + case "unknown": + return ClaimResponseStatus.Unknown; + } + throw new Exception("Cannot unmarshal type ClaimResponseStatus"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (ClaimResponseStatus)untypedValue; + switch (value) + { + case ClaimResponseStatus.Accepted: + serializer.Serialize(writer, "accepted"); + return; + case ClaimResponseStatus.Rejected: + serializer.Serialize(writer, "rejected"); + return; + case ClaimResponseStatus.Unknown: + serializer.Serialize(writer, "unknown"); + return; + } + throw new Exception("Cannot marshal type ClaimResponseStatus"); + } + + public static readonly ClaimResponseStatusConverter Singleton = new ClaimResponseStatusConverter(); + } + + internal class ConsentStatusConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(ConsentStatus) || t == typeof(ConsentStatus?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "active": + return ConsentStatus.Active; + case "rejected": + return ConsentStatus.Rejected; + } + throw new Exception("Cannot unmarshal type ConsentStatus"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (ConsentStatus)untypedValue; + switch (value) + { + case ConsentStatus.Active: + serializer.Serialize(writer, "active"); + return; + case ConsentStatus.Rejected: + serializer.Serialize(writer, "rejected"); + return; + } + throw new Exception("Cannot marshal type ConsentStatus"); + } + + public static readonly ConsentStatusConverter Singleton = new ConsentStatusConverter(); + } + + internal class MtbDiagnosisTumorSpreadConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(MtbDiagnosisTumorSpread) || t == typeof(MtbDiagnosisTumorSpread?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "local": + return MtbDiagnosisTumorSpread.Local; + case "metastasized": + return MtbDiagnosisTumorSpread.Metastasized; + case "tumor-free": + return MtbDiagnosisTumorSpread.TumorFree; + case "unknown": + return MtbDiagnosisTumorSpread.Unknown; + } + throw new Exception("Cannot unmarshal type MtbDiagnosisTumorSpread"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (MtbDiagnosisTumorSpread)untypedValue; + switch (value) + { + case MtbDiagnosisTumorSpread.Local: + serializer.Serialize(writer, "local"); + return; + case MtbDiagnosisTumorSpread.Metastasized: + serializer.Serialize(writer, "metastasized"); + return; + case MtbDiagnosisTumorSpread.TumorFree: + serializer.Serialize(writer, "tumor-free"); + return; + case MtbDiagnosisTumorSpread.Unknown: + serializer.Serialize(writer, "unknown"); + return; + } + throw new Exception("Cannot marshal type MtbDiagnosisTumorSpread"); + } + + public static readonly MtbDiagnosisTumorSpreadConverter Singleton = new MtbDiagnosisTumorSpreadConverter(); + } + + internal class PurpleCodeConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(PurpleCode) || t == typeof(PurpleCode?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "0": + return PurpleCode.Code0; + case "1": + return PurpleCode.Code1; + case "2": + return PurpleCode.Code2; + case "3": + return PurpleCode.Code3; + case "4": + return PurpleCode.Code4; + } + throw new Exception("Cannot unmarshal type PurpleCode"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (PurpleCode)untypedValue; + switch (value) + { + case PurpleCode.Code0: + serializer.Serialize(writer, "0"); + return; + case PurpleCode.Code1: + serializer.Serialize(writer, "1"); + return; + case PurpleCode.Code2: + serializer.Serialize(writer, "2"); + return; + case PurpleCode.Code3: + serializer.Serialize(writer, "3"); + return; + case PurpleCode.Code4: + serializer.Serialize(writer, "4"); + return; + } + throw new Exception("Cannot marshal type PurpleCode"); + } + + public static readonly PurpleCodeConverter Singleton = new PurpleCodeConverter(); + } + + internal class SpecimenTypeConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(SpecimenType) || t == typeof(SpecimenType?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + if (value == "TumorSpecimen") + { + return SpecimenType.TumorSpecimen; + } + throw new Exception("Cannot unmarshal type SpecimenType"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (SpecimenType)untypedValue; + if (value == SpecimenType.TumorSpecimen) + { + serializer.Serialize(writer, "TumorSpecimen"); + return; + } + throw new Exception("Cannot marshal type SpecimenType"); + } + + public static readonly SpecimenTypeConverter Singleton = new SpecimenTypeConverter(); + } + + internal class TumorCellContentMethodConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(TumorCellContentMethod) || t == typeof(TumorCellContentMethod?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "bioinformatic": + return TumorCellContentMethod.Bioinformatic; + case "histologic": + return TumorCellContentMethod.Histologic; + } + throw new Exception("Cannot unmarshal type TumorCellContentMethod"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (TumorCellContentMethod)untypedValue; + switch (value) + { + case TumorCellContentMethod.Bioinformatic: + serializer.Serialize(writer, "bioinformatic"); + return; + case TumorCellContentMethod.Histologic: + serializer.Serialize(writer, "histologic"); + return; + } + throw new Exception("Cannot marshal type TumorCellContentMethod"); + } + + public static readonly TumorCellContentMethodConverter Singleton = new TumorCellContentMethodConverter(); + } + + internal class NotDoneReasonCodeConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(NotDoneReasonCode) || t == typeof(NotDoneReasonCode?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "chronic-remission": + return NotDoneReasonCode.ChronicRemission; + case "continued-externally": + return NotDoneReasonCode.ContinuedExternally; + case "deterioration": + return NotDoneReasonCode.Deterioration; + case "lost-to-fu": + return NotDoneReasonCode.LostToFu; + case "medical-reason": + return NotDoneReasonCode.MedicalReason; + case "no-indication": + return NotDoneReasonCode.NoIndication; + case "other": + return NotDoneReasonCode.Other; + case "other-therapy-chosen": + return NotDoneReasonCode.OtherTherapyChosen; + case "patient-death": + return NotDoneReasonCode.PatientDeath; + case "patient-refusal": + return NotDoneReasonCode.PatientRefusal; + case "patient-wish": + return NotDoneReasonCode.PatientWish; + case "payment-ended": + return NotDoneReasonCode.PaymentEnded; + case "payment-pending": + return NotDoneReasonCode.PaymentPending; + case "payment-refused": + return NotDoneReasonCode.PaymentRefused; + case "progression": + return NotDoneReasonCode.Progression; + case "toxicity": + return NotDoneReasonCode.Toxicity; + case "unknown": + return NotDoneReasonCode.Unknown; + } + throw new Exception("Cannot unmarshal type NotDoneReasonCode"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (NotDoneReasonCode)untypedValue; + switch (value) + { + case NotDoneReasonCode.ChronicRemission: + serializer.Serialize(writer, "chronic-remission"); + return; + case NotDoneReasonCode.ContinuedExternally: + serializer.Serialize(writer, "continued-externally"); + return; + case NotDoneReasonCode.Deterioration: + serializer.Serialize(writer, "deterioration"); + return; + case NotDoneReasonCode.LostToFu: + serializer.Serialize(writer, "lost-to-fu"); + return; + case NotDoneReasonCode.MedicalReason: + serializer.Serialize(writer, "medical-reason"); + return; + case NotDoneReasonCode.NoIndication: + serializer.Serialize(writer, "no-indication"); + return; + case NotDoneReasonCode.Other: + serializer.Serialize(writer, "other"); + return; + case NotDoneReasonCode.OtherTherapyChosen: + serializer.Serialize(writer, "other-therapy-chosen"); + return; + case NotDoneReasonCode.PatientDeath: + serializer.Serialize(writer, "patient-death"); + return; + case NotDoneReasonCode.PatientRefusal: + serializer.Serialize(writer, "patient-refusal"); + return; + case NotDoneReasonCode.PatientWish: + serializer.Serialize(writer, "patient-wish"); + return; + case NotDoneReasonCode.PaymentEnded: + serializer.Serialize(writer, "payment-ended"); + return; + case NotDoneReasonCode.PaymentPending: + serializer.Serialize(writer, "payment-pending"); + return; + case NotDoneReasonCode.PaymentRefused: + serializer.Serialize(writer, "payment-refused"); + return; + case NotDoneReasonCode.Progression: + serializer.Serialize(writer, "progression"); + return; + case NotDoneReasonCode.Toxicity: + serializer.Serialize(writer, "toxicity"); + return; + case NotDoneReasonCode.Unknown: + serializer.Serialize(writer, "unknown"); + return; + } + throw new Exception("Cannot marshal type NotDoneReasonCode"); + } + + public static readonly NotDoneReasonCodeConverter Singleton = new NotDoneReasonCodeConverter(); + } + + internal class TherapyStatusConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(TherapyStatus) || t == typeof(TherapyStatus?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "completed": + return TherapyStatus.Completed; + case "not-done": + return TherapyStatus.NotDone; + case "on-going": + return TherapyStatus.OnGoing; + case "stopped": + return TherapyStatus.Stopped; + case "unknown": + return TherapyStatus.Unknown; + } + throw new Exception("Cannot unmarshal type TherapyStatus"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (TherapyStatus)untypedValue; + switch (value) + { + case TherapyStatus.Completed: + serializer.Serialize(writer, "completed"); + return; + case TherapyStatus.NotDone: + serializer.Serialize(writer, "not-done"); + return; + case TherapyStatus.OnGoing: + serializer.Serialize(writer, "on-going"); + return; + case TherapyStatus.Stopped: + serializer.Serialize(writer, "stopped"); + return; + case TherapyStatus.Unknown: + serializer.Serialize(writer, "unknown"); + return; + } + throw new Exception("Cannot marshal type TherapyStatus"); + } + + public static readonly TherapyStatusConverter Singleton = new TherapyStatusConverter(); + } + + internal class ChromosomeConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(Chromosome) || t == typeof(Chromosome?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "chr1": + return Chromosome.Chr1; + case "chr10": + return Chromosome.Chr10; + case "chr11": + return Chromosome.Chr11; + case "chr12": + return Chromosome.Chr12; + case "chr13": + return Chromosome.Chr13; + case "chr14": + return Chromosome.Chr14; + case "chr15": + return Chromosome.Chr15; + case "chr16": + return Chromosome.Chr16; + case "chr17": + return Chromosome.Chr17; + case "chr18": + return Chromosome.Chr18; + case "chr19": + return Chromosome.Chr19; + case "chr2": + return Chromosome.Chr2; + case "chr20": + return Chromosome.Chr20; + case "chr21": + return Chromosome.Chr21; + case "chr22": + return Chromosome.Chr22; + case "chr3": + return Chromosome.Chr3; + case "chr4": + return Chromosome.Chr4; + case "chr5": + return Chromosome.Chr5; + case "chr6": + return Chromosome.Chr6; + case "chr7": + return Chromosome.Chr7; + case "chr8": + return Chromosome.Chr8; + case "chr9": + return Chromosome.Chr9; + case "chrX": + return Chromosome.ChrX; + case "chrY": + return Chromosome.ChrY; + } + throw new Exception("Cannot unmarshal type Chromosome"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (Chromosome)untypedValue; + switch (value) + { + case Chromosome.Chr1: + serializer.Serialize(writer, "chr1"); + return; + case Chromosome.Chr10: + serializer.Serialize(writer, "chr10"); + return; + case Chromosome.Chr11: + serializer.Serialize(writer, "chr11"); + return; + case Chromosome.Chr12: + serializer.Serialize(writer, "chr12"); + return; + case Chromosome.Chr13: + serializer.Serialize(writer, "chr13"); + return; + case Chromosome.Chr14: + serializer.Serialize(writer, "chr14"); + return; + case Chromosome.Chr15: + serializer.Serialize(writer, "chr15"); + return; + case Chromosome.Chr16: + serializer.Serialize(writer, "chr16"); + return; + case Chromosome.Chr17: + serializer.Serialize(writer, "chr17"); + return; + case Chromosome.Chr18: + serializer.Serialize(writer, "chr18"); + return; + case Chromosome.Chr19: + serializer.Serialize(writer, "chr19"); + return; + case Chromosome.Chr2: + serializer.Serialize(writer, "chr2"); + return; + case Chromosome.Chr20: + serializer.Serialize(writer, "chr20"); + return; + case Chromosome.Chr21: + serializer.Serialize(writer, "chr21"); + return; + case Chromosome.Chr22: + serializer.Serialize(writer, "chr22"); + return; + case Chromosome.Chr3: + serializer.Serialize(writer, "chr3"); + return; + case Chromosome.Chr4: + serializer.Serialize(writer, "chr4"); + return; + case Chromosome.Chr5: + serializer.Serialize(writer, "chr5"); + return; + case Chromosome.Chr6: + serializer.Serialize(writer, "chr6"); + return; + case Chromosome.Chr7: + serializer.Serialize(writer, "chr7"); + return; + case Chromosome.Chr8: + serializer.Serialize(writer, "chr8"); + return; + case Chromosome.Chr9: + serializer.Serialize(writer, "chr9"); + return; + case Chromosome.ChrX: + serializer.Serialize(writer, "chrX"); + return; + case Chromosome.ChrY: + serializer.Serialize(writer, "chrY"); + return; + } + throw new Exception("Cannot marshal type Chromosome"); + } + + public static readonly ChromosomeConverter Singleton = new ChromosomeConverter(); + } + + internal class CnvTypeConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(CnvType) || t == typeof(CnvType?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "high-level-gain": + return CnvType.HighLevelGain; + case "loss": + return CnvType.Loss; + case "low-level-gain": + return CnvType.LowLevelGain; + } + throw new Exception("Cannot unmarshal type CnvType"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (CnvType)untypedValue; + switch (value) + { + case CnvType.HighLevelGain: + serializer.Serialize(writer, "high-level-gain"); + return; + case CnvType.Loss: + serializer.Serialize(writer, "loss"); + return; + case CnvType.LowLevelGain: + serializer.Serialize(writer, "low-level-gain"); + return; + } + throw new Exception("Cannot marshal type CnvType"); + } + + public static readonly CnvTypeConverter Singleton = new CnvTypeConverter(); + } + + internal class RnaFusionStrandConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(RnaFusionStrand) || t == typeof(RnaFusionStrand?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "+": + return RnaFusionStrand.Empty; + case "-": + return RnaFusionStrand.RnaFusionStrand; + } + throw new Exception("Cannot unmarshal type RnaFusionStrand"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (RnaFusionStrand)untypedValue; + switch (value) + { + case RnaFusionStrand.Empty: + serializer.Serialize(writer, "+"); + return; + case RnaFusionStrand.RnaFusionStrand: + serializer.Serialize(writer, "-"); + return; + } + throw new Exception("Cannot marshal type RnaFusionStrand"); + } + + public static readonly RnaFusionStrandConverter Singleton = new RnaFusionStrandConverter(); + } + + internal class GenderConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(Gender) || t == typeof(Gender?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "female": + return Gender.Female; + case "male": + return Gender.Male; + case "other": + return Gender.Other; + case "unknown": + return Gender.Unknown; + } + throw new Exception("Cannot unmarshal type Gender"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (Gender)untypedValue; + switch (value) + { + case Gender.Female: + serializer.Serialize(writer, "female"); + return; + case Gender.Male: + serializer.Serialize(writer, "male"); + return; + case Gender.Other: + serializer.Serialize(writer, "other"); + return; + case Gender.Unknown: + serializer.Serialize(writer, "unknown"); + return; + } + throw new Exception("Cannot marshal type Gender"); + } + + public static readonly GenderConverter Singleton = new GenderConverter(); + } + + internal class AddendumCodeConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(AddendumCode) || t == typeof(AddendumCode?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "R": + return AddendumCode.R; + case "Z": + return AddendumCode.Z; + case "is": + return AddendumCode.Is; + case "iv": + return AddendumCode.Iv; + } + throw new Exception("Cannot unmarshal type AddendumCode"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (AddendumCode)untypedValue; + switch (value) + { + case AddendumCode.R: + serializer.Serialize(writer, "R"); + return; + case AddendumCode.Z: + serializer.Serialize(writer, "Z"); + return; + case AddendumCode.Is: + serializer.Serialize(writer, "is"); + return; + case AddendumCode.Iv: + serializer.Serialize(writer, "iv"); + return; + } + throw new Exception("Cannot marshal type AddendumCode"); + } + + public static readonly AddendumCodeConverter Singleton = new AddendumCodeConverter(); + } + + internal class GradingCodeConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(GradingCode) || t == typeof(GradingCode?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "m1A": + return GradingCode.M1A; + case "m1B": + return GradingCode.M1B; + case "m1C": + return GradingCode.M1C; + case "m2A": + return GradingCode.M2A; + case "m2B": + return GradingCode.M2B; + case "m2C": + return GradingCode.M2C; + case "m3": + return GradingCode.M3; + case "m4": + return GradingCode.M4; + case "undefined": + return GradingCode.Undefined; + } + throw new Exception("Cannot unmarshal type GradingCode"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (GradingCode)untypedValue; + switch (value) + { + case GradingCode.M1A: + serializer.Serialize(writer, "m1A"); + return; + case GradingCode.M1B: + serializer.Serialize(writer, "m1B"); + return; + case GradingCode.M1C: + serializer.Serialize(writer, "m1C"); + return; + case GradingCode.M2A: + serializer.Serialize(writer, "m2A"); + return; + case GradingCode.M2B: + serializer.Serialize(writer, "m2B"); + return; + case GradingCode.M2C: + serializer.Serialize(writer, "m2C"); + return; + case GradingCode.M3: + serializer.Serialize(writer, "m3"); + return; + case GradingCode.M4: + serializer.Serialize(writer, "m4"); + return; + case GradingCode.Undefined: + serializer.Serialize(writer, "undefined"); + return; + } + throw new Exception("Cannot marshal type GradingCode"); + } + + public static readonly GradingCodeConverter Singleton = new GradingCodeConverter(); + } + + internal class SystemEnumConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(SystemEnum) || t == typeof(SystemEnum?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + if (value == "https://pubmed.ncbi.nlm.nih.gov/") + { + return SystemEnum.HttpsPubmedNcbiNlmNihGov; + } + throw new Exception("Cannot unmarshal type SystemEnum"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (SystemEnum)untypedValue; + if (value == SystemEnum.HttpsPubmedNcbiNlmNihGov) + { + serializer.Serialize(writer, "https://pubmed.ncbi.nlm.nih.gov/"); + return; + } + throw new Exception("Cannot marshal type SystemEnum"); + } + + public static readonly SystemEnumConverter Singleton = new SystemEnumConverter(); + } + + internal class TherapyRecommendationPriorityConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(TherapyRecommendationPriority) || t == typeof(TherapyRecommendationPriority?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "1": + return TherapyRecommendationPriority.Priority1; + case "2": + return TherapyRecommendationPriority.Priority2; + case "3": + return TherapyRecommendationPriority.Priority3; + case "4": + return TherapyRecommendationPriority.Priority4; + } + throw new Exception("Cannot unmarshal type TherapyRecommendationPriority"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (TherapyRecommendationPriority)untypedValue; + switch (value) + { + case TherapyRecommendationPriority.Priority1: + serializer.Serialize(writer, "1"); + return; + case TherapyRecommendationPriority.Priority2: + serializer.Serialize(writer, "2"); + return; + case TherapyRecommendationPriority.Priority3: + serializer.Serialize(writer, "3"); + return; + case TherapyRecommendationPriority.Priority4: + serializer.Serialize(writer, "4"); + return; + } + throw new Exception("Cannot marshal type TherapyRecommendationPriority"); + } + + public static readonly TherapyRecommendationPriorityConverter Singleton = new TherapyRecommendationPriorityConverter(); + } + + internal class ResponseTherapyTypeConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(ResponseTherapyType) || t == typeof(ResponseTherapyType?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + if (value == "MTBMedicationTherapy") + { + return ResponseTherapyType.MtbMedicationTherapy; + } + throw new Exception("Cannot unmarshal type ResponseTherapyType"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (ResponseTherapyType)untypedValue; + if (value == ResponseTherapyType.MtbMedicationTherapy) + { + serializer.Serialize(writer, "MTBMedicationTherapy"); + return; + } + throw new Exception("Cannot marshal type ResponseTherapyType"); + } + + public static readonly ResponseTherapyTypeConverter Singleton = new ResponseTherapyTypeConverter(); + } + + internal class FluffyCodeConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(FluffyCode) || t == typeof(FluffyCode?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "CR": + return FluffyCode.Cr; + case "MR": + return FluffyCode.Mr; + case "NA": + return FluffyCode.Na; + case "NYA": + return FluffyCode.Nya; + case "PD": + return FluffyCode.Pd; + case "PR": + return FluffyCode.Pr; + case "SD": + return FluffyCode.Sd; + } + throw new Exception("Cannot unmarshal type FluffyCode"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (FluffyCode)untypedValue; + switch (value) + { + case FluffyCode.Cr: + serializer.Serialize(writer, "CR"); + return; + case FluffyCode.Mr: + serializer.Serialize(writer, "MR"); + return; + case FluffyCode.Na: + serializer.Serialize(writer, "NA"); + return; + case FluffyCode.Nya: + serializer.Serialize(writer, "NYA"); + return; + case FluffyCode.Pd: + serializer.Serialize(writer, "PD"); + return; + case FluffyCode.Pr: + serializer.Serialize(writer, "PR"); + return; + case FluffyCode.Sd: + serializer.Serialize(writer, "SD"); + return; + } + throw new Exception("Cannot marshal type FluffyCode"); + } + + public static readonly FluffyCodeConverter Singleton = new FluffyCodeConverter(); + } + + internal class TumorSpecimenCollectionLocalizationConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(TumorSpecimenCollectionLocalization) || t == typeof(TumorSpecimenCollectionLocalization?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "metastasis": + return TumorSpecimenCollectionLocalization.Metastasis; + case "primary-tumor": + return TumorSpecimenCollectionLocalization.PrimaryTumor; + case "unknown": + return TumorSpecimenCollectionLocalization.Unknown; + } + throw new Exception("Cannot unmarshal type TumorSpecimenCollectionLocalization"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (TumorSpecimenCollectionLocalization)untypedValue; + switch (value) + { + case TumorSpecimenCollectionLocalization.Metastasis: + serializer.Serialize(writer, "metastasis"); + return; + case TumorSpecimenCollectionLocalization.PrimaryTumor: + serializer.Serialize(writer, "primary-tumor"); + return; + case TumorSpecimenCollectionLocalization.Unknown: + serializer.Serialize(writer, "unknown"); + return; + } + throw new Exception("Cannot marshal type TumorSpecimenCollectionLocalization"); + } + + public static readonly TumorSpecimenCollectionLocalizationConverter Singleton = new TumorSpecimenCollectionLocalizationConverter(); + } + + internal class TumorSpecimenCollectionMethodConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(TumorSpecimenCollectionMethod) || t == typeof(TumorSpecimenCollectionMethod?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "biopsy": + return TumorSpecimenCollectionMethod.Biopsy; + case "cytology": + return TumorSpecimenCollectionMethod.Cytology; + case "liquid-biopsy": + return TumorSpecimenCollectionMethod.LiquidBiopsy; + case "resection": + return TumorSpecimenCollectionMethod.Resection; + case "unknown": + return TumorSpecimenCollectionMethod.Unknown; + } + throw new Exception("Cannot unmarshal type TumorSpecimenCollectionMethod"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (TumorSpecimenCollectionMethod)untypedValue; + switch (value) + { + case TumorSpecimenCollectionMethod.Biopsy: + serializer.Serialize(writer, "biopsy"); + return; + case TumorSpecimenCollectionMethod.Cytology: + serializer.Serialize(writer, "cytology"); + return; + case TumorSpecimenCollectionMethod.LiquidBiopsy: + serializer.Serialize(writer, "liquid-biopsy"); + return; + case TumorSpecimenCollectionMethod.Resection: + serializer.Serialize(writer, "resection"); + return; + case TumorSpecimenCollectionMethod.Unknown: + serializer.Serialize(writer, "unknown"); + return; + } + throw new Exception("Cannot marshal type TumorSpecimenCollectionMethod"); + } + + public static readonly TumorSpecimenCollectionMethodConverter Singleton = new TumorSpecimenCollectionMethodConverter(); + } + + internal class TumorSpecimenTypeConverter : JsonConverter + { + public override bool CanConvert(Type t) => t == typeof(TumorSpecimenType) || t == typeof(TumorSpecimenType?); + + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) return null; + var value = serializer.Deserialize(reader); + switch (value) + { + case "FFPE": + return TumorSpecimenType.Ffpe; + case "cryo-frozen": + return TumorSpecimenType.CryoFrozen; + case "fresh-tissue": + return TumorSpecimenType.FreshTissue; + case "liquid-biopsy": + return TumorSpecimenType.LiquidBiopsy; + case "unknown": + return TumorSpecimenType.Unknown; + } + throw new Exception("Cannot unmarshal type TumorSpecimenType"); + } + + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) + { + if (untypedValue == null) + { + serializer.Serialize(writer, null); + return; + } + var value = (TumorSpecimenType)untypedValue; + switch (value) + { + case TumorSpecimenType.Ffpe: + serializer.Serialize(writer, "FFPE"); + return; + case TumorSpecimenType.CryoFrozen: + serializer.Serialize(writer, "cryo-frozen"); + return; + case TumorSpecimenType.FreshTissue: + serializer.Serialize(writer, "fresh-tissue"); + return; + case TumorSpecimenType.LiquidBiopsy: + serializer.Serialize(writer, "liquid-biopsy"); + return; + case TumorSpecimenType.Unknown: + serializer.Serialize(writer, "unknown"); + return; + } + throw new Exception("Cannot marshal type TumorSpecimenType"); + } + + public static readonly TumorSpecimenTypeConverter Singleton = new TumorSpecimenTypeConverter(); + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..b15880a --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# DNPM:DIP MTB Data-Transfer-Objects for .NET + +Serialization and deserialization of DNPM:DIP MTB DTOs for .NET using the C# programming language. + +This crate provides DNPM:DIP data model for use with "Modellvorhaben gem. §64e SGB V" + +## Usage notices + +This library uses `NewtonSoft.Json` to handle JSON strings. \ No newline at end of file diff --git a/mv64e-mtb-dto-dotnet.sln b/mv64e-mtb-dto-dotnet.sln new file mode 100644 index 0000000..8adf10d --- /dev/null +++ b/mv64e-mtb-dto-dotnet.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MV64e.MTB", "MV64e.MTB\MV64e.MTB.csproj", "{AA08ED31-46FE-4DE0-97EC-F09357CDF44A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MV64e.MTB.Test", "MV64e.MTB.Test\MV64e.MTB.Test.csproj", "{C10B9692-A326-4FB8-8D81-1B3FB9E915F7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AA08ED31-46FE-4DE0-97EC-F09357CDF44A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA08ED31-46FE-4DE0-97EC-F09357CDF44A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA08ED31-46FE-4DE0-97EC-F09357CDF44A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA08ED31-46FE-4DE0-97EC-F09357CDF44A}.Release|Any CPU.Build.0 = Release|Any CPU + {C10B9692-A326-4FB8-8D81-1B3FB9E915F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C10B9692-A326-4FB8-8D81-1B3FB9E915F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C10B9692-A326-4FB8-8D81-1B3FB9E915F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C10B9692-A326-4FB8-8D81-1B3FB9E915F7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal