コード例 #1
0
  @Test
  public void should_parse_takst_drug_version_2() throws Exception {
    LaegemiddelFactory config = new LaegemiddelFactory();
    File file =
        createFileWithContent(
            config,
            "28100110949SPLMXYLOCA00200985Xylocain                      inj.væske, opløsningINJVSKO       10 mg/ml            0000010000MGM056100056100 N01BB02EDIRIVPE                          ");
    List<Laegemiddel> drugs =
        new FixedLengthFileParser(new File[] {file}).parse(config, Laegemiddel.class);

    // Assert

    Date now = new Date();
    Takst takst = new Takst(now, now);
    TakstDataset<Laegemiddel> ds = new TakstDataset<Laegemiddel>(takst, drugs, Laegemiddel.class);
    takst.addDataset(ds, Laegemiddel.class);

    Laegemiddel drug = drugs.get(0);
    assertEquals("Xylocain", drug.getNavn());
    assertEquals(new Long(28100110949l), drug.getDrugid());
    assertEquals(new Double(10), drug.getStyrkeNumerisk());
    assertEquals("10 mg/ml", drug.getStyrkeKlarTekst());
    assertFalse(drug.getEgnetTilDosisdispensering());
    assertEquals("N01BB02", drug.getATC());
    assertEquals("INJVSKO", drug.getFormKode());
    assertEquals("EDIRIVPE", drug.getAdministrationsvejKode());
    assertEquals("inj.væske, opløsning", drug.getLaegemiddelformTekst());
  }
コード例 #2
0
  @Test
  public void testLMS01() throws Exception {
    LaegemiddelFactory config = new LaegemiddelFactory();
    File file =
        createFileWithContent(
            config,
            "28100009555SPLMKEMADR00100065Kemadrin                      tabletter           TAB           5 mg                0000005000MG 059300059300 N04AA04OR               D                ");
    List<Laegemiddel> drugs =
        new FixedLengthFileParser(new File[] {file}).parse(config, Laegemiddel.class);

    Date now = new Date();
    Takst takst = new Takst(now, now);
    TakstDataset<Laegemiddel> ds = new TakstDataset<Laegemiddel>(takst, drugs, Laegemiddel.class);
    takst.addDataset(ds, Laegemiddel.class);

    Laegemiddel drug = drugs.get(0);
    assertEquals("Kemadrin", drug.getNavn());
    assertEquals(new Long(28100009555l), drug.getDrugid());
    assertEquals(new Double(5.0), drug.getStyrkeNumerisk());
    assertEquals("5 mg", drug.getStyrkeKlarTekst());
    assertTrue(drug.getEgnetTilDosisdispensering());
    assertEquals("N04AA04", drug.getATC());
    assertEquals("TAB", drug.getFormKode());
    assertEquals("tabletter", drug.getLaegemiddelformTekst());
    assertEquals("OR", drug.getAdministrationsvejKode());
    assertEquals("KEMADR001", drug.getAlfabetSekvensplads());
    assertEquals(null, drug.getDatoForAfregistrAfLaegemiddel());
    assertEquals(null, drug.getKodeForYderligereFormOplysn());
    assertEquals(null, drug.getLaegemidletsSubstitutionsgruppe());
    assertEquals(new Long(59300), drug.getMTIndehaverKode());
    assertEquals(new Long(59300), drug.getRepraesentantDistributoerKode());
    assertEquals(new Long(65), drug.getSpecNummer());
    assertEquals(null, drug.getSubstitution());
    assertEquals(false, drug.getTrafikadvarsel());
    assertEquals("LM", drug.getVaredeltype());
    assertEquals("SP", drug.getVaretype());
  }