@@ -14,7 +14,6 @@ import {
1414} from "@root/typeschema/types" ;
1515import type { TypeSchemaIndex } from "@root/typeschema/utils" ;
1616import {
17- tsCamelCase ,
1817 tsExtensionFlatTypeName ,
1918 tsFieldName ,
2019 tsModulePath ,
@@ -555,11 +554,7 @@ const generateFactoryMethods = (
555554 w . line ( ) ;
556555} ;
557556
558- const generateFieldAccessors = (
559- w : TypeScript ,
560- factoryInfo : ProfileFactoryInfo ,
561- extSliceMethodBaseNames : Set < string > ,
562- ) => {
557+ const generateFieldAccessors = ( w : TypeScript , factoryInfo : ProfileFactoryInfo ) => {
563558 w . line ( "// Field accessors" ) ;
564559 for ( const p of factoryInfo . params ) {
565560 const methodBaseName = uppercaseFirstLetter ( p . name ) ;
@@ -574,10 +569,8 @@ const generateFieldAccessors = (
574569 w . line ( ) ;
575570 }
576571
577- // Getter and setter methods for choice instance fields (skip if extension/slice has same name)
578572 for ( const a of factoryInfo . accessors ) {
579- const methodBaseName = uppercaseFirstLetter ( tsCamelCase ( a . name ) ) ;
580- if ( extSliceMethodBaseNames . has ( methodBaseName ) ) continue ;
573+ const methodBaseName = uppercaseFirstLetter ( a . name ) ;
581574 const fieldAccess = tsFieldName ( a . name ) ;
582575 w . curlyBlock ( [ `get${ methodBaseName } ` , "()" , `: ${ a . tsType } | undefined` ] , ( ) => {
583576 w . lineSM ( `return ${ tsGet ( "this.resource" , fieldAccess ) } as ${ a . tsType } | undefined` ) ;
@@ -721,18 +714,6 @@ const generateFlatInputType = (w: TypeScript, flatProfile: ProfileTypeSchema) =>
721714 w . line ( ) ;
722715} ;
723716
724- /** Collect all resolved base names (extensions + slices) for field accessor dedup. */
725- const collectAllBaseNames = ( flatProfile : ProfileTypeSchema , sliceDefs : SliceDef [ ] ) : Set < string > => {
726- const names = new Set < string > ( ) ;
727- for ( const ext of flatProfile . extensions ?? [ ] ) {
728- if ( ext . url ) names . add ( ext . nameCandidates . recommended ) ;
729- }
730- for ( const slice of sliceDefs ) {
731- names . add ( slice . baseName ) ;
732- }
733- return names ;
734- } ;
735-
736717export const generateProfileClass = ( w : TypeScript , tsIndex : TypeSchemaIndex , flatProfile : ProfileTypeSchema ) => {
737718 const tsBaseResourceName = tsTypeFromIdentifier ( flatProfile . base ) ;
738719 const profileClassName = tsProfileClassName ( flatProfile ) ;
@@ -750,16 +731,14 @@ export const generateProfileClass = (w: TypeScript, tsIndex: TypeSchemaIndex, fl
750731 const canonicalUrl = flatProfile . identifier . url ;
751732 w . comment ( "CanonicalURL:" , canonicalUrl , `(pkg: ${ packageMetaToFhir ( packageMeta ( flatProfile ) ) } )` ) ;
752733
753- const allBaseNames = collectAllBaseNames ( flatProfile , sliceDefs ) ;
754-
755734 w . curlyBlock ( [ "export" , "class" , profileClassName ] , ( ) => {
756735 w . lineSM ( `static readonly canonicalUrl = ${ JSON . stringify ( canonicalUrl ) } ` ) ;
757736 w . line ( ) ;
758737 generateStaticSliceFields ( w , sliceDefs ) ;
759738 w . lineSM ( `private resource: ${ tsBaseResourceName } ` ) ;
760739 w . line ( ) ;
761740 generateFactoryMethods ( w , tsIndex , flatProfile , factoryInfo ) ;
762- generateFieldAccessors ( w , factoryInfo , allBaseNames ) ;
741+ generateFieldAccessors ( w , factoryInfo ) ;
763742
764743 w . line ( "// Extensions" ) ;
765744 generateExtensionMethods ( w , tsIndex , flatProfile ) ;
0 commit comments