-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZANR als Erweiterung zu LANR eingeführt
- Loading branch information
Oli B
committed
Feb 9, 2024
1 parent
0c6ffca
commit 10cc436
Showing
7 changed files
with
160 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ package "med" { | |
class PZN | ||
class SNOMED | ||
class Versichertennummer | ||
class ZANR | ||
|
||
LANR <|-- ZANR | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright (c) 2024 by Oli B. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express orimplied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* (c)reated 09.02.24 by oboehm | ||
*/ | ||
package de.jfachwert.med | ||
|
||
import de.jfachwert.KSimpleValidator | ||
import de.jfachwert.pruefung.NullValidator | ||
import java.util.* | ||
|
||
/** | ||
* Die Zahnarztnummer (ZANR) entspricht im wesentlichen der LANR. | ||
* Sie ist seit 1.1.2023 verpflichtend (s.a. | ||
* https://www.kzv-berlin.de/fuer-praxen/abrechnung/zahnarztnummer). | ||
* | ||
* @author oboehm | ||
* @since 5.3 (09.02.24) | ||
*/ | ||
open class ZANR | ||
/** | ||
* Erzeugt ein neues LANR-Objekt. | ||
* | ||
* @param code neunstellige Zahl | ||
* @param validator Validator zur Pruefung der Zahl | ||
*/ | ||
@JvmOverloads constructor(code: Int, validator: KSimpleValidator<Int> = VALIDATOR) : LANR(code, validator) { | ||
|
||
override fun isZahnarzt(): Boolean { | ||
return true | ||
} | ||
|
||
companion object { | ||
|
||
private val WEAK_CACHE = WeakHashMap<Int, ZANR>() | ||
|
||
/** Null-Konstante fuer Initialisierungen. */ | ||
@JvmField | ||
val NULL = ZANR(0, NullValidator()) | ||
|
||
/** | ||
* Liefert eine ZANR zurueck. | ||
* | ||
* @param code 9-stellige Nummer | ||
* @return die ZANR | ||
*/ | ||
@JvmStatic | ||
fun of(code: Int): ZANR { | ||
return WEAK_CACHE.computeIfAbsent(code) { n: Int -> ZANR(n) } | ||
} | ||
|
||
/** | ||
* Liefert eine LANR zurueck. | ||
* | ||
* @param code 9-stellige Nummer | ||
* @return die LANR | ||
*/ | ||
@JvmStatic | ||
fun of(code: String): ZANR { | ||
return of(code.toInt()) | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2024 by Oli B. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express orimplied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* (c)reated 09.02.24 by oboehm | ||
*/ | ||
package de.jfachwert.med; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
/** | ||
* Unit-Tests fuer ZANR. | ||
* | ||
* @author oboehm | ||
*/ | ||
public class ZANRTest extends LANRTest { | ||
|
||
/** | ||
* Zum Testen verwenden wir die ZANR-Klasse | ||
* | ||
* @param nr LA-Nummer | ||
* @return Test-Objekt zum Testen | ||
*/ | ||
@Override | ||
protected ZANR createFachwert(String nr) { | ||
return ZANR.of(nr); | ||
} | ||
|
||
@Test | ||
@Override | ||
public void testIstKeinZahnarzt() { | ||
assertTrue(ZANR.of(345678975).isZahnarzt()); | ||
} | ||
|
||
} |